···275275 return Err(Error::CannotPublishTodo { unfinished });
276276 }
277277278278- // TODO: This is commented out until we figure out a better way to
279279- // deal with reexports of internal types.
280280- // As things stand it would break both Lustre and Mist.
281281- // You can see the thread starting around here for more
282282- // context: https://discord.com/channels/768594524158427167/768594524158427170/1227250677734969386
283283- //
284284- //
285285- // If any of the modules in the package contain a leaked internal type then
278278+ // TODO: If any of the modules in the package contain a leaked internal type then
286279 // refuse to publish as the package is not yet finished.
287287- // let unfinished = built
288288- // .root_package
289289- // .modules
290290- // .iter()
291291- // .filter(|module| module.ast.type_info.leaks_internal_types)
292292- // .map(|module| module.name.clone())
293293- // .sorted()
294294- // .collect_vec();
295295- // if !unfinished.is_empty() {
296296- // return Err(Error::CannotPublishLeakedInternalType { unfinished });
297297- // }
280280+ // We need to move aliases in to the type system first.
281281+ // context: https://discord.com/channels/768594524158427167/768594524158427170/1227250677734969386
298282299283 // Collect all the files we want to include in the tarball
300284 let generated_files = match target {
···252252 env.accessors
253253 .retain(|_, accessors| accessors.publicity.is_importable());
254254255255- let mut leaked_internal_type_encountered = false;
256256-257255 // Ensure no exported values have private types in their type signature
258256 for value in env.module_values.values() {
259257 if value.publicity.is_private() {
···276274 if package_config.is_internal_module(name.as_str()) {
277275 continue;
278276 }
279279- if let Some(_leaked) = value.type_.find_internal_type() {
280280- leaked_internal_type_encountered = true;
281281- // TODO: This is commented out until we figure out a better way to
282282- // deal with reexports of internal types.
283283- // As things stand it would break both Lustre and Mist.
284284- // You can see the thread starting around here for more
285285- // context: https://discord.com/channels/768594524158427167/768594524158427170/1227250677734969386
286286- //
287287- // env.warnings.emit(type_::Warning::InternalTypeLeak {
288288- // location: value.variant.definition_location(),
289289- // leaked,
290290- // })
291291- }
292277 }
293278294279 let Environment {
···317302 is_internal,
318303 unused_imports,
319304 contains_todo,
320320- leaks_internal_types: leaked_internal_type_encountered,
321305 line_numbers,
322306 src_path,
323307 },
···570570 pub accessors: HashMap<EcoString, AccessorsMap>,
571571 pub unused_imports: Vec<SrcSpan>,
572572 pub contains_todo: bool,
573573- pub leaks_internal_types: bool,
574573 /// Used for mapping to original source locations on disk
575574 pub line_numbers: LineNumbers,
576575 /// Used for determining the source path of the module on disk
···661660 accessors: Default::default(),
662661 unused_imports: Default::default(),
663662 contains_todo: false,
664664- leaks_internal_types: false,
665663 is_internal: false,
666664 line_numbers,
667665 src_path,