Skip to content

Commit 8afbb49

Browse files
committed
check initialization in community build
1 parent 8b25cea commit 8afbb49

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ final case class SbtCommunityProject(
102102
private val baseCommand =
103103
"clean; set logLevel in Global := Level.Error; set updateOptions in Global ~= (_.withLatestSnapshots(false)); "
104104
++ s"""set dependencyOverrides in ThisBuild ++= ${dependencyOverrides.mkString("Seq(", ", ", ")")}; """
105+
++ """set scalacOptions in Global += "-Ycheck-init";"""
105106
++ s"++$compilerVersion!; "
106107

107108
override val testCommand = s"$baseCommand$sbtTestCommand"

compiler/src/dotty/tools/dotc/transform/init/Summarization.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ object Summarization {
318318
val ctor = cls.primaryConstructor
319319
val prefixEff =
320320
if tref.prefix == NoPrefix then Effects.empty
321-
else Summarization.analyze(New(ref.tpe))(env.withOwner(ctor.owner)).effs
321+
else Summarization.analyze(tref.prefix, ref)(env.withOwner(ctor.owner)).effs
322322

323323
prefixEff + MethodCall(ThisRef()(ref), ctor)(ref)
324324
}

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CompilationTests {
3939
compileFilesInDir("tests/new", defaultOptions),
4040
compileFilesInDir("tests/pos-scala2", scala2CompatMode),
4141
compileFilesInDir("tests/pos-custom-args/erased", defaultOptions.and("-Yerased-terms")),
42-
compileFilesInDir("tests/pos", defaultOptions),
42+
compileFilesInDir("tests/pos", defaultOptions.and("-Ycheck-init")),
4343
compileFilesInDir("tests/pos-deep-subtype", allowDeepSubtypes),
4444
compileFile(
4545
// succeeds despite -Xfatal-warnings because of -nowarn
@@ -184,7 +184,7 @@ class CompilationTests {
184184
compileFile("tests/run-custom-args/defaults-serizaliable-no-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"),
185185
compileFilesInDir("tests/run-custom-args/erased", defaultOptions.and("-Yerased-terms")),
186186
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
187-
compileFilesInDir("tests/run", defaultOptions)
187+
compileFilesInDir("tests/run", defaultOptions.and("-Ycheck-init"))
188188
).checkRuns()
189189
}
190190

0 commit comments

Comments
 (0)