Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SI-5167 An impl class method should refer to its own parameter symbols.
Rather than those of the original method in the trait. If they are shared, parameter renaming in the implementaion class is visible in the original method. This led to a crash in the resident compiler when looking up the default argument getter.
- Loading branch information
Showing
5 changed files
with
40 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
nsc> | ||
nsc> | ||
nsc> |
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,2 @@ | ||
t5167/t5167_1.scala | ||
t5167/t5167_2.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,12 @@ | ||
package compilerbug | ||
|
||
trait SadTrait { | ||
def buggyMethod[T](argWithDefault1: Int = 0)(argWithDefault2: String = "default") { | ||
for (i <- 0 to 1) { | ||
val x = argWithDefault1 | ||
val y = argWithDefault2 | ||
} | ||
} | ||
} | ||
|
||
object SadObject extends SadTrait |
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 @@ | ||
package compilerbug | ||
|
||
class TestClass { | ||
def repro() { | ||
SadObject.buggyMethod[Int]()() | ||
} | ||
} |