MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / check_import_export_collisions

Method check_import_export_collisions

src/compilation_pipeline.rs:557–588  ·  view source on GitHub ↗
(
        label: &str,
        exports: &std::collections::HashSet<String>,
        local_names: &std::collections::HashSet<String>,
        imported_exports: &mut std::collections::HashMap<String, St

Source from the content-addressed store, hash-verified

555 })?;
556 aliases.insert(
557 alias,
558 hll_to_ir::imports::ModuleAlias {
559 prefix,
560 member_aliases,
561 exports,
562 mangled,
563 namespaced,
564 declared,
565 },
566 );
567 }
568 }
569
570 prelude.push_str(&self.source_prelude);
571
572 Ok(ResolvedModules {
573 prelude: (!prelude.is_empty()).then_some(prelude),
574 aliases,
575 })
576 }
577
578 fn check_import_export_collisions(
579 label: &str,
580 exports: &std::collections::HashSet<String>,
581 local_names: &std::collections::HashSet<String>,
582 imported_exports: &mut std::collections::HashMap<String, String>,
583 ) -> Result<(), Vec<Diagnostic>> {
584 // Sort for deterministic diagnostics across runs (sets are unordered).
585 let mut sorted_exports: Vec<&String> = exports.iter().collect();
586 sorted_exports.sort();
587 for export in &sorted_exports {
588 if local_names.contains(*export) {
589 return Err(vec![Diagnostic::new(
590 DiagnosticLevel::Error,
591 format!(

Callers

nothing calls this directly

Calls 5

collectMethod · 0.80
getMethod · 0.80
containsMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected