Skip to content

Commit fc5cd47

Browse files
committed
Merge pull request #712 from smarter/add/vc-test
Tests that objects nested in value class methods work
2 parents d4e80f4 + 7a25e65 commit fc5cd47

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class M(val t: Int) extends AnyVal {
2+
// Disallowed in Scala 2.11 (see SI-6359)
3+
def o = {
4+
object X {
5+
override def toString = t.toString
6+
}
7+
() => X
8+
}
9+
}
10+
11+
object Test {
12+
def main(args: Array[String]): Unit = {
13+
val x = new M(3)
14+
println(x.o())
15+
}
16+
}

0 commit comments

Comments
 (0)