diff --git a/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/AmbiguousImportsAnalysis.java b/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/AmbiguousImportsAnalysis.java index bfbe7aabd1..1bbbdd054a 100644 --- a/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/AmbiguousImportsAnalysis.java +++ b/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/AmbiguousImportsAnalysis.java @@ -102,8 +102,8 @@ public final class AmbiguousImportsAnalysis implements MiniPassFactory { public Module transformModule(Module moduleIr) { var newImports = new ArrayList(); moduleIr.imports().foreach(imp -> { - if (imp instanceof Import.Module impMod) { - var errs = analyseAmbiguousSymbols(impMod); + var errs = analyseAmbiguousSymbols(imp); + if (!errs.isEmpty()) { newImports.addAll(errs); } else { newImports.add(imp);