forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
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 scala#4519 from dotty-staging/fix-4496-part1
Selectable: catch correct exception when the field isn't found
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
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,11 @@ | ||
import scala.reflect.Selectable.reflectiveSelectable | ||
class Foo1 { val a: Int = 10 } | ||
class Foo2 { def a: Int = 10 } | ||
class Foo3 { var a: Int = 10 } | ||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
assert((new Foo1 : {val a: Int}).a == 10) | ||
assert((new Foo2 : {val a: Int}).a == 10) | ||
assert((new Foo3 : {val a: Int}).a == 10) | ||
} | ||
} |