Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SI-6928, VerifyError with self reference to super.
A bug in typers mishandled varargs. We should get more aggressive about eliminating all the ad hoc parameter/argument handling code spread everywhere. For varargs especially: any code which tries to make an adjustment based on a repeated parameter is more likely to be wrong than right. In aggregate these reinventions are a huge source of bugs.
- Loading branch information
Showing
5 changed files
with
75 additions
and
44 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,7 @@ | ||
t6928.scala:2: error: super constructor cannot be passed a self reference unless parameter is declared by-name | ||
object B extends A(B) | ||
^ | ||
t6928.scala:3: error: super constructor cannot be passed a self reference unless parameter is declared by-name | ||
object C extends A(null, null, C) | ||
^ | ||
two errors found |
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,10 @@ | ||
abstract class A( val someAs: A* ) | ||
object B extends A(B) | ||
object C extends A(null, null, C) | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
println(B.someAs) | ||
println(C.someAs) | ||
} | ||
} |
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 As |
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,10 @@ | ||
abstract class A( val someAs: A* ) { | ||
override def toString = someAs.length + " As" | ||
} | ||
object B extends A(null, null, null) | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
println(B) | ||
} | ||
} |