Skip to content

Commit 322f4d0

Browse files
committed
check initialization in community build
1 parent 7910e35 commit 322f4d0

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
@@ -96,6 +96,7 @@ final case class SbtCommunityProject(
9696

9797
private val baseCommand =
9898
"clean; set logLevel in Global := Level.Error; set updateOptions in Global ~= (_.withLatestSnapshots(false)); "
99+
++ """set scalacOptions in Global += "-Ycheck-init";"""
99100
++ s"++$compilerVersion!; "
100101

101102
override val testCommand =

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
@@ -40,7 +40,7 @@ class CompilationTests {
4040
compileFilesInDir("tests/new", defaultOptions),
4141
compileFilesInDir("tests/pos-scala2", scala2CompatMode),
4242
compileFilesInDir("tests/pos-custom-args/erased", defaultOptions.and("-Yerased-terms")),
43-
compileFilesInDir("tests/pos", defaultOptions),
43+
compileFilesInDir("tests/pos", defaultOptions.and("-Ycheck-init")),
4444
compileFilesInDir("tests/pos-deep-subtype", allowDeepSubtypes),
4545
compileFile(
4646
// succeeds despite -Xfatal-warnings because of -nowarn
@@ -187,7 +187,7 @@ class CompilationTests {
187187
compileFile("tests/run-custom-args/defaults-serizaliable-no-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"),
188188
compileFilesInDir("tests/run-custom-args/erased", defaultOptions.and("-Yerased-terms")),
189189
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
190-
compileFilesInDir("tests/run", defaultOptions)
190+
compileFilesInDir("tests/run", defaultOptions.and("-Ycheck-init"))
191191
).checkRuns()
192192
}
193193

0 commit comments

Comments
 (0)