mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Remove requires type from the provides field
This commit is contained in:
parent
bdb6651c13
commit
c61b7bf2a6
3 changed files with 7 additions and 13 deletions
|
@ -1,7 +1,4 @@
|
||||||
app "fibonacci"
|
app [main, main2] { pf: platform "fibonacci-platform/main.roc" }
|
||||||
packages { pf: "fibonacci-platform/main.roc" }
|
|
||||||
imports []
|
|
||||||
provides [main] to pf
|
|
||||||
|
|
||||||
main = \n -> fib n 0 1
|
main = \n -> fib n 0 1
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ use roc_parse::ast::{self, CommentOrNewline, ExtractSpaces, Spaced, ValueDef};
|
||||||
use roc_parse::header::parse_module_defs;
|
use roc_parse::header::parse_module_defs;
|
||||||
use roc_parse::header::{
|
use roc_parse::header::{
|
||||||
self, AppHeader, ExposedName, HeaderType, ImportsKeywordItem, PackageEntry, PackageHeader,
|
self, AppHeader, ExposedName, HeaderType, ImportsKeywordItem, PackageEntry, PackageHeader,
|
||||||
PlatformHeader, To, TypedIdent,
|
PlatformHeader, To,
|
||||||
};
|
};
|
||||||
use roc_parse::parser::{FileError, SourceError, SyntaxError};
|
use roc_parse::parser::{FileError, SourceError, SyntaxError};
|
||||||
use roc_problem::Severity;
|
use roc_problem::Severity;
|
||||||
|
@ -667,7 +667,7 @@ enum PlatformPath<'a> {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct PlatformData<'a> {
|
struct PlatformData<'a> {
|
||||||
module_id: ModuleId,
|
module_id: ModuleId,
|
||||||
provides: &'a [(Loc<ExposedName<'a>>, Loc<TypedIdent<'a>>)],
|
provides: &'a [Loc<ExposedName<'a>>],
|
||||||
is_prebuilt: bool,
|
is_prebuilt: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3185,7 +3185,7 @@ fn finish_specialization<'a>(
|
||||||
let mut buf =
|
let mut buf =
|
||||||
bumpalo::collections::Vec::with_capacity_in(provides.len(), arena);
|
bumpalo::collections::Vec::with_capacity_in(provides.len(), arena);
|
||||||
|
|
||||||
for (loc_name, _loc_typed_ident) in provides {
|
for loc_name in provides {
|
||||||
let ident_id = ident_ids.get_or_insert(loc_name.value.as_str());
|
let ident_id = ident_ids.get_or_insert(loc_name.value.as_str());
|
||||||
let symbol = Symbol::new(module_id, ident_id);
|
let symbol = Symbol::new(module_id, ident_id);
|
||||||
let proc_layout =
|
let proc_layout =
|
||||||
|
@ -4996,10 +4996,7 @@ fn build_platform_header<'a>(
|
||||||
})
|
})
|
||||||
.items;
|
.items;
|
||||||
let provides = bumpalo::collections::Vec::from_iter_in(
|
let provides = bumpalo::collections::Vec::from_iter_in(
|
||||||
unspace(arena, header.provides.item.items)
|
unspace(arena, header.provides.item.items).iter().copied(),
|
||||||
.iter()
|
|
||||||
.copied()
|
|
||||||
.zip(dbg!(&requires).iter().copied()),
|
|
||||||
arena,
|
arena,
|
||||||
);
|
);
|
||||||
let packages = unspace(arena, header.packages.item.items);
|
let packages = unspace(arena, header.packages.item.items);
|
||||||
|
@ -5451,7 +5448,7 @@ fn parse<'a>(
|
||||||
if let HeaderType::Platform { provides, .. } = header.header_type {
|
if let HeaderType::Platform { provides, .. } = header.header_type {
|
||||||
exposed.reserve(provides.len());
|
exposed.reserve(provides.len());
|
||||||
|
|
||||||
for (loc_name, _loc_typed_ident) in provides.iter() {
|
for loc_name in provides.iter() {
|
||||||
// Use get_or_insert here because the ident_ids may already
|
// Use get_or_insert here because the ident_ids may already
|
||||||
// created an IdentId for this, when it was imported exposed
|
// created an IdentId for this, when it was imported exposed
|
||||||
// in a dependent module.
|
// in a dependent module.
|
||||||
|
|
|
@ -954,7 +954,7 @@ pub enum HeaderType<'a> {
|
||||||
opt_app_module_id: Option<ModuleId>,
|
opt_app_module_id: Option<ModuleId>,
|
||||||
/// the name and type scheme of the main function (required by the platform)
|
/// the name and type scheme of the main function (required by the platform)
|
||||||
/// (type scheme is currently unused)
|
/// (type scheme is currently unused)
|
||||||
provides: &'a [(Loc<ExposedName<'a>>, Loc<TypedIdent<'a>>)],
|
provides: &'a [Loc<ExposedName<'a>>],
|
||||||
requires: &'a [Loc<TypedIdent<'a>>],
|
requires: &'a [Loc<TypedIdent<'a>>],
|
||||||
requires_types: &'a [Loc<UppercaseIdent<'a>>],
|
requires_types: &'a [Loc<UppercaseIdent<'a>>],
|
||||||
exposes: &'a [Loc<ModuleName<'a>>],
|
exposes: &'a [Loc<ModuleName<'a>>],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue