Skip to content

Fix #4185: Do not check names for modules that will not be emitted #4187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions compiler/src/dotty/tools/backend/jvm/GenBCode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
}
}
checkName(claszSymbol)
if (int.symHelper(claszSymbol).isModuleClass)
checkName(claszSymbol.companionModule)
if (int.symHelper(claszSymbol).isModuleClass) {
val companionModule = claszSymbol.companionModule
if (int.symHelper(companionModule.owner).isPackageClass)
checkName(companionModule)
}

// -------------- mirror class, if needed --------------
val mirrorC =
Expand Down
1 change: 1 addition & 0 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class CompilationTests extends ParallelTesting {
compileFile("tests/pos-special/i3323b.scala", defaultOptions.and("-Xfatal-warnings")) +
compileFile("tests/pos-special/i3589-b.scala", defaultOptions.and("-Xfatal-warnings")) +
compileFile("tests/pos-special/i4166.scala", defaultOptions.and("-Xfatal-warnings")) +
compileFile("tests/pos-special/i4185.scala", defaultOptions.and("-Xfatal-warnings")) +
compileFile("tests/pos-special/completeFromSource/Test.scala", defaultOptions.and("-sourcepath", "tests/pos-special")) +
compileFile("tests/pos-special/completeFromSource/Test2.scala", defaultOptions.and("-sourcepath", "tests/pos-special")) +
compileFile("tests/pos-special/completeFromSource/Test3.scala", defaultOptions.and("-sourcepath", "tests/pos-special", "-scansource")) +
Expand Down
4 changes: 4 additions & 0 deletions tests/pos-special/i4185.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
object ord {
class Ord
object Ord
}