diff options
author | Dmitry Petrashko <dark@d-d.me> | 2015-07-22 11:28:08 +0200 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2015-07-22 11:28:08 +0200 |
commit | b3ca8e167bd2f3871dab7d394ee70c6132295a31 (patch) | |
tree | a63f79cf9aaf52581c2fa0adf359f0512be0beff | |
parent | ed8b3f0f7581174887ae1c7c8fc3b01609a3a9cb (diff) | |
parent | 7eef035ea617be1f38c9d901b6c08ee8982fb73e (diff) | |
download | dotty-b3ca8e167bd2f3871dab7d394ee70c6132295a31.tar.gz dotty-b3ca8e167bd2f3871dab7d394ee70c6132295a31.tar.bz2 dotty-b3ca8e167bd2f3871dab7d394ee70c6132295a31.zip |
Merge pull request #724 from dotty-staging/labels-Ycheck
Enable Ycheck after labelDef. Fixes #701
-rw-r--r-- | .travis.yml | 15 | ||||
-rw-r--r-- | project/Build.scala | 10 | ||||
-rwxr-xr-x | scripts/common | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Phases.scala | 6 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/TreeChecker.scala | 3 | ||||
-rw-r--r-- | test/dotc/tests.scala | 11 |
6 files changed, 21 insertions, 26 deletions
diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c8061b4f8..000000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: scala -script: - - sbt -Ddotty.travis.build=yes update compile test scalastyle -jdk: - - oraclejdk8 -notifications: - email: - - dotty-reports@googlegroups.com -branches: - only: - - master -before_install: - - cd .. - - git clone https://github.com/scala/scala.git - - cd dotty diff --git a/project/Build.scala b/project/Build.scala index 473ef2443..9c80fdc11 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -8,7 +8,7 @@ object DottyBuild extends Build { val travisMemLimit = List("-Xmx1g", "-Xss2m") - val TRAVIS_BUILD = "dotty.travis.build" + val JENKINS_BUILD = "dotty.jenkins.build" val agentOptions = List( // "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" @@ -104,8 +104,8 @@ object DottyBuild extends Build { // System.err.println("BOOTPATH: " + fullpath) val travis_build = // propagate if this is a travis build - if (sys.props.isDefinedAt(TRAVIS_BUILD)) - List(s"-D$TRAVIS_BUILD=${sys.props(TRAVIS_BUILD)}") ::: travisMemLimit + if (sys.props.isDefinedAt(JENKINS_BUILD)) + List(s"-D$JENKINS_BUILD=${sys.props(JENKINS_BUILD)}") ::: travisMemLimit else List() @@ -156,8 +156,8 @@ object DottyBuild extends Build { // System.err.println("BOOTPATH: " + fullpath) val travis_build = // propagate if this is a travis build - if (sys.props.isDefinedAt(TRAVIS_BUILD)) - List(s"-D$TRAVIS_BUILD=${sys.props(TRAVIS_BUILD)}") + if (sys.props.isDefinedAt(JENKINS_BUILD)) + List(s"-D$JENKINS_BUILD=${sys.props(JENKINS_BUILD)}") else List() val res = agentOptions ::: travis_build ::: fullpath diff --git a/scripts/common b/scripts/common index 4924538f0..a51a60a01 100755 --- a/scripts/common +++ b/scripts/common @@ -14,4 +14,4 @@ update() { export LC_ALL=en_US.UTF-8 -sbtArgs="-Ddotty.travis.build=yes -Dfile.encoding=UTF-8 -ivy $baseDir/ivy2 -Dsbt.global.base=$HOME/.sbt/0.13 -sbt-dir $HOME/.sbt/0.13" +sbtArgs="-Ddotty.jenkins.build=yes -Dfile.encoding=UTF-8 -ivy $baseDir/ivy2 -Dsbt.global.base=$HOME/.sbt/0.13 -sbt-dir $HOME/.sbt/0.13" diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala index b086308a2..42b03484e 100644 --- a/src/dotty/tools/dotc/core/Phases.scala +++ b/src/dotty/tools/dotc/core/Phases.scala @@ -3,7 +3,7 @@ package core import Periods._ import Contexts._ -import dotty.tools.backend.jvm.GenBCode +import dotty.tools.backend.jvm.{LabelDefs, GenBCode} import util.DotClass import DenotTransformers._ import Denotations._ @@ -296,6 +296,8 @@ object Phases { private var myFlatClasses = false private var myRefChecked = false private var mySymbolicRefs = false + private var myLabelsReordered = false + /** The sequence position of this phase in the given context where 0 * is reserved for NoPhase and the first real phase is at position 1. @@ -311,6 +313,7 @@ object Phases { final def flatClasses = myFlatClasses // Phase is after flatten final def refChecked = myRefChecked // Phase is after RefChecks final def symbolicRefs = mySymbolicRefs // Phase is after ResolveSuper, newly generated TermRefs should be symbolic + final def labelsReordered = myLabelsReordered // Phase is after LabelDefs, labels are flattened and owner chains don't mirror this protected[Phases] def init(base: ContextBase, start: Int, end:Int): Unit = { if (start >= FirstPhaseId) @@ -321,6 +324,7 @@ object Phases { myFlatClasses = prev.getClass == classOf[Flatten] || prev.flatClasses myRefChecked = prev.getClass == classOf[RefChecks] || prev.refChecked mySymbolicRefs = prev.getClass == classOf[ResolveSuper] || prev.symbolicRefs + myLabelsReordered = prev.getClass == classOf[LabelDefs] || prev.labelsReordered } protected[Phases] def init(base: ContextBase, id: Int): Unit = init(base, id, id) diff --git a/src/dotty/tools/dotc/transform/TreeChecker.scala b/src/dotty/tools/dotc/transform/TreeChecker.scala index 0e69b9d1f..b76f04b58 100644 --- a/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -242,7 +242,8 @@ class TreeChecker extends Phase with SymTransformer { private def checkOwner(tree: untpd.Tree)(implicit ctx: Context): Unit = { def ownerMatches(symOwner: Symbol, ctxOwner: Symbol): Boolean = symOwner == ctxOwner || - ctxOwner.isWeakOwner && ownerMatches(symOwner, ctxOwner.owner) + ctxOwner.isWeakOwner && ownerMatches(symOwner, ctxOwner.owner) || + ctx.phase.labelsReordered && symOwner.isWeakOwner && ownerMatches(symOwner.owner, ctxOwner) assert(ownerMatches(tree.symbol.owner, ctx.owner), i"bad owner; ${tree.symbol} has owner ${tree.symbol.owner}, expected was ${ctx.owner}\n" + i"owner chain = ${tree.symbol.ownersIterator.toList}%, %, ctxOwners = ${ctx.outersIterator.map(_.owner).toList}%, %") diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 838b4dbb3..50fa90d53 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -8,6 +8,8 @@ import org.junit.experimental.categories._ class tests extends CompilerTest { + def isRunByJenkins: Boolean = sys.props.isDefinedAt("dotty.jenkins.build") + val noCheckOptions = List( // "-verbose", // "-Ylog:frontend", @@ -20,9 +22,12 @@ class tests extends CompilerTest { implicit val defaultOptions = noCheckOptions ++ List( "-Yno-deep-subtypes", "-Yno-double-bindings", - "-Ycheck:tailrec,resolveSuper,mixin,restoreScopes", - "-d", defaultOutputDir - ) + "-d", defaultOutputDir) ++ { + if (isRunByJenkins) List("-Ycheck:-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") // should be Ycheck:all, but #725 + else List("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") + } + + val testPickling = List("-Xprint-types", "-Ytest-pickler", "-Ystop-after:pickler") val twice = List("#runs", "2") |