diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala | 8 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_1/A.scala | 4 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_1/B.scala | 3 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_1/t2650_1.changes/A2.scala | 3 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_1/t2650_1.check | 11 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_1/t2650_1.test | 3 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_2/A.scala | 3 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_2/B.scala | 4 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_2/t2650_2.changes/A2.scala | 4 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_2/t2650_2.check | 13 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_2/t2650_2.test | 3 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_3/A.scala | 4 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_3/B.scala | 3 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_3/t2650_3.changes/A2.scala | 4 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_3/t2650_3.check | 13 | ||||
-rw-r--r-- | test/files/buildmanager/t2650_3/t2650_3.test | 3 |
17 files changed, 87 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 3504f019d4..9c7fc42f00 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -686,6 +686,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable val typerPhase = phaseNamed("typer") val picklerPhase = phaseNamed("pickler") val refchecksPhase = phaseNamed("refchecks") + val uncurryPhase = phaseNamed("uncurry") val explicitOuterPhase = phaseNamed("explicitouter") val erasurePhase = phaseNamed("erasure") diff --git a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala index 95115dc68e..58ff10948f 100644 --- a/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala +++ b/src/compiler/scala/tools/nsc/dependencies/DependencyAnalysis.scala @@ -161,6 +161,9 @@ trait DependencyAnalysis extends SubComponent with Files { || (tree.symbol.sourceFile.path != file.path)) && (!tree.symbol.isClassConstructor)) { updateReferences(tree.symbol.fullNameString) + atPhase(currentRun.uncurryPhase.prev) { + checkType(tree.symbol.tpe) + } } tree match { @@ -200,9 +203,14 @@ trait DependencyAnalysis extends SubComponent with Files { for (s <- t.params) checkType(s.tpe) case t: TypeRef => + if (t.sym.isAliasType) updateReferences(t.typeSymbolDirect.fullNameString) updateReferences(t.typeSymbol.fullNameString) for (tp <- t.args) checkType(tp) + case t: PolyType => + checkType(t.resultType) + updateReferences(t.typeSymbol.fullNameString) + case t => updateReferences(t.typeSymbol.fullNameString) } diff --git a/test/files/buildmanager/t2650_1/A.scala b/test/files/buildmanager/t2650_1/A.scala new file mode 100644 index 0000000000..74714a3c47 --- /dev/null +++ b/test/files/buildmanager/t2650_1/A.scala @@ -0,0 +1,4 @@ +trait A { + type S[_] +} + diff --git a/test/files/buildmanager/t2650_1/B.scala b/test/files/buildmanager/t2650_1/B.scala new file mode 100644 index 0000000000..80f0e30259 --- /dev/null +++ b/test/files/buildmanager/t2650_1/B.scala @@ -0,0 +1,3 @@ +trait B extends A { + type F = S[Int] +} diff --git a/test/files/buildmanager/t2650_1/t2650_1.changes/A2.scala b/test/files/buildmanager/t2650_1/t2650_1.changes/A2.scala new file mode 100644 index 0000000000..2b8ead4ff1 --- /dev/null +++ b/test/files/buildmanager/t2650_1/t2650_1.changes/A2.scala @@ -0,0 +1,3 @@ +trait A { + type S +} diff --git a/test/files/buildmanager/t2650_1/t2650_1.check b/test/files/buildmanager/t2650_1/t2650_1.check new file mode 100644 index 0000000000..ecddb33620 --- /dev/null +++ b/test/files/buildmanager/t2650_1/t2650_1.check @@ -0,0 +1,11 @@ +builder > A.scala B.scala +compiling Set(A.scala, B.scala) +Changes: Map() +builder > A.scala +compiling Set(A.scala) +Changes: Map(trait A -> List(Changed(Definition(A.S))[type S changed from A.this.S[_] to A.this.S flags: <deferred>])) +invalidate B.scala because inherited method changed [Changed(Definition(A.S))[type S changed from A.this.S[_] to A.this.S flags: <deferred>]] +compiling Set(B.scala) +B.scala:2: error: B.this.S does not take type parameters + type F = S[Int] + ^ diff --git a/test/files/buildmanager/t2650_1/t2650_1.test b/test/files/buildmanager/t2650_1/t2650_1.test new file mode 100644 index 0000000000..6f3bd03361 --- /dev/null +++ b/test/files/buildmanager/t2650_1/t2650_1.test @@ -0,0 +1,3 @@ +>>compile A.scala B.scala +>>update A.scala=>A2.scala +>>compile A.scala diff --git a/test/files/buildmanager/t2650_2/A.scala b/test/files/buildmanager/t2650_2/A.scala new file mode 100644 index 0000000000..bcea634485 --- /dev/null +++ b/test/files/buildmanager/t2650_2/A.scala @@ -0,0 +1,3 @@ +trait A { + type S = Int +} diff --git a/test/files/buildmanager/t2650_2/B.scala b/test/files/buildmanager/t2650_2/B.scala new file mode 100644 index 0000000000..22a3a9a48e --- /dev/null +++ b/test/files/buildmanager/t2650_2/B.scala @@ -0,0 +1,4 @@ +trait B extends A { + def x: S + def y: Int = x +} diff --git a/test/files/buildmanager/t2650_2/t2650_2.changes/A2.scala b/test/files/buildmanager/t2650_2/t2650_2.changes/A2.scala new file mode 100644 index 0000000000..8274c1b62d --- /dev/null +++ b/test/files/buildmanager/t2650_2/t2650_2.changes/A2.scala @@ -0,0 +1,4 @@ +trait A { + type S = Long +} + diff --git a/test/files/buildmanager/t2650_2/t2650_2.check b/test/files/buildmanager/t2650_2/t2650_2.check new file mode 100644 index 0000000000..7ab72fb619 --- /dev/null +++ b/test/files/buildmanager/t2650_2/t2650_2.check @@ -0,0 +1,13 @@ +builder > A.scala B.scala +compiling Set(A.scala, B.scala) +Changes: Map() +builder > A.scala +compiling Set(A.scala) +Changes: Map(trait A -> List(Changed(Definition(A.S))[type S changed from A.this.S to A.this.S flags: ])) +invalidate B.scala because inherited method changed [Changed(Definition(A.S))[type S changed from A.this.S to A.this.S flags: ]] +compiling Set(B.scala) +B.scala:3: error: type mismatch; + found : B.this.S + required: Int + def y: Int = x + ^ diff --git a/test/files/buildmanager/t2650_2/t2650_2.test b/test/files/buildmanager/t2650_2/t2650_2.test new file mode 100644 index 0000000000..6f3bd03361 --- /dev/null +++ b/test/files/buildmanager/t2650_2/t2650_2.test @@ -0,0 +1,3 @@ +>>compile A.scala B.scala +>>update A.scala=>A2.scala +>>compile A.scala diff --git a/test/files/buildmanager/t2650_3/A.scala b/test/files/buildmanager/t2650_3/A.scala new file mode 100644 index 0000000000..cd13843eb9 --- /dev/null +++ b/test/files/buildmanager/t2650_3/A.scala @@ -0,0 +1,4 @@ +trait A { + type T = Int + def x: T +} diff --git a/test/files/buildmanager/t2650_3/B.scala b/test/files/buildmanager/t2650_3/B.scala new file mode 100644 index 0000000000..46a8cf270a --- /dev/null +++ b/test/files/buildmanager/t2650_3/B.scala @@ -0,0 +1,3 @@ +object B { + def x(a: A): Int = a.x +} diff --git a/test/files/buildmanager/t2650_3/t2650_3.changes/A2.scala b/test/files/buildmanager/t2650_3/t2650_3.changes/A2.scala new file mode 100644 index 0000000000..e5667b2539 --- /dev/null +++ b/test/files/buildmanager/t2650_3/t2650_3.changes/A2.scala @@ -0,0 +1,4 @@ +trait A { + type T = Long + def x: T +} diff --git a/test/files/buildmanager/t2650_3/t2650_3.check b/test/files/buildmanager/t2650_3/t2650_3.check new file mode 100644 index 0000000000..27be2f5ae8 --- /dev/null +++ b/test/files/buildmanager/t2650_3/t2650_3.check @@ -0,0 +1,13 @@ +builder > A.scala B.scala +compiling Set(A.scala, B.scala) +Changes: Map() +builder > A.scala +compiling Set(A.scala) +Changes: Map(trait A -> List(Changed(Definition(A.T))[type T changed from A.this.T to A.this.T flags: ])) +invalidate B.scala because it references changed definition [Changed(Definition(A.T))[type T changed from A.this.T to A.this.T flags: ]] +compiling Set(B.scala) +B.scala:2: error: type mismatch; + found : a.T + required: Int + def x(a: A): Int = a.x + ^ diff --git a/test/files/buildmanager/t2650_3/t2650_3.test b/test/files/buildmanager/t2650_3/t2650_3.test new file mode 100644 index 0000000000..6f3bd03361 --- /dev/null +++ b/test/files/buildmanager/t2650_3/t2650_3.test @@ -0,0 +1,3 @@ +>>compile A.scala B.scala +>>update A.scala=>A2.scala +>>compile A.scala |