Don't give packages names

This commit is contained in:
Richard Feldman 2022-12-10 01:43:53 -05:00
parent e3687935a3
commit 222e0193a3
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
2 changed files with 5 additions and 8 deletions

View file

@ -4075,9 +4075,7 @@ fn build_header<'a>(
let declared_name: ModuleName = match &header_type {
HeaderType::App { .. } => ModuleName::APP.into(),
HeaderType::Platform {
name,
opt_app_module_id,
..
opt_app_module_id, ..
} => {
// Add standard imports, if there is an app module.
// (There might not be, e.g. when running `roc check myplatform.roc` or
@ -4090,9 +4088,10 @@ fn build_header<'a>(
);
}
// Do NOT use | here, since we don't want to verify the filename
// like we do in other contexts. Any platform filename is okay!
name.as_str().into()
// Platforms do not have names. This is important because otherwise
// those names end up in host-generated symbols, and they may contain
// characters that hosts might not allow in their function names.
String::new().into()
}
HeaderType::Interface { name, .. }
| HeaderType::Builtin { name, .. }
@ -4892,7 +4891,6 @@ fn build_platform_header<'a>(
let imports = unspace(arena, header.imports.item.items);
let header_type = HeaderType::Platform {
name: header.name.value,
// A config_shorthand of "" should be fine
config_shorthand: opt_shorthand.unwrap_or_default(),
opt_app_module_id,

View file

@ -26,7 +26,6 @@ pub enum HeaderType<'a> {
generates_with: &'a [Symbol],
},
Platform {
name: PackageName<'a>,
opt_app_module_id: Option<ModuleId>,
/// the name and type scheme of the main function (required by the platform)
/// (type scheme is currently unused)