Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/src/scala/reflect/Selectable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Selectable(val receiver: Any) extends AnyVal with scala.Selectable {
fld.get(receiver)
}
catch {
case ex: NoSuchFieldError =>
case ex: NoSuchFieldException =>
selectDynamicMethod(name).asInstanceOf[() => Any]()
}
}
Expand Down
11 changes: 11 additions & 0 deletions tests/run/i4496a.scala
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)
}
}