-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1324 from Friendseeker/this-context-dependent
Avoid spurious recompilations when unrelated constructor with default argument changes
- Loading branch information
Showing
8 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
zinc/src/sbt-test/source-dependencies/constructors-unrelated-2/A.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class A { | ||
var z = B.z // introduce a member ref dependency to B | ||
var c: C = new C(1) | ||
} |
7 changes: 7 additions & 0 deletions
7
zinc/src/sbt-test/source-dependencies/constructors-unrelated-2/B.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class B(val z: Int) { | ||
def this(x: Int, y: Int = 2) = this(x + y) | ||
} | ||
|
||
object B { | ||
val z = 1 | ||
} |
3 changes: 3 additions & 0 deletions
3
zinc/src/sbt-test/source-dependencies/constructors-unrelated-2/C.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class C(z: String) { | ||
def this(x: Int, y: Int = 2) = this("") | ||
} |
7 changes: 7 additions & 0 deletions
7
zinc/src/sbt-test/source-dependencies/constructors-unrelated-2/changes/B.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class B(val z: Int) { | ||
def this(x: Int, y: String = "") = this(x + y.toInt) | ||
} | ||
|
||
object B { | ||
val z = 1 | ||
} |
3 changes: 3 additions & 0 deletions
3
zinc/src/sbt-test/source-dependencies/constructors-unrelated-2/changes/C.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class C(z: String) { | ||
def this(x: Boolean, y: Int = 2) = this("") | ||
} |
8 changes: 8 additions & 0 deletions
8
zinc/src/sbt-test/source-dependencies/constructors-unrelated-2/test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
> compile | ||
$ copy-file changes/B.scala B.scala | ||
# Second compilation round, there should be no third round (we don't need to recompile A.scala) | ||
> compile | ||
# Check that there were only two rounds of compilation | ||
> checkIterations 2 | ||
$ copy-file changes/C.scala C.scala | ||
-> compile |