Skip to content
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ final case class SbtCommunityProject(
private val baseCommand =
"clean; set logLevel in Global := Level.Error; set updateOptions in Global ~= (_.withLatestSnapshots(false)); "
++ s"""set dependencyOverrides in ThisBuild ++= ${dependencyOverrides.mkString("Seq(", ", ", ")")}; """
++ """set scalacOptions in Global += "-Ycheck-init";"""
++ s"++$compilerVersion!; "

override val testCommand = s"$baseCommand$sbtTestCommand"
Expand Down
5 changes: 3 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/init/Checker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ast.tpd
import dotty.tools.dotc.core._
import Contexts._
import Types._
import Symbols._

import dotty.tools.dotc.transform._
import MegaPhase._
Expand Down Expand Up @@ -45,9 +46,9 @@ class Checker extends MiniPhase {
}

// A concrete class may not be instantiated if the self type is not satisfied
if (instantiable) {
if (instantiable && cls.enclosingPackageClass != defn.StdLibPatchesPackage.moduleClass) {
implicit val state: Checking.State = Checking.State(
visited = Set.empty,
checked = Set.empty,
path = Vector.empty,
thisClass = cls,
fieldsInited = mutable.Set.empty,
Expand Down
Loading