diff options
Diffstat (limited to 'test/files/run/t7817.scala')
-rw-r--r-- | test/files/run/t7817.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/files/run/t7817.scala b/test/files/run/t7817.scala new file mode 100644 index 0000000000..905b8aeb09 --- /dev/null +++ b/test/files/run/t7817.scala @@ -0,0 +1,31 @@ +import language.reflectiveCalls + +package test { + class C1 { + object O { + def struct(s: {def foo: Any}) = s.foo + } + } + trait T { + object O { + def struct(s: {def foo: Any}) = s.foo + } + } + object O1 extends T + + object O2 { + object O { + def struct(s: {def foo: Any}) = s.foo + } + } +} + +object Test extends App { + object fooable { def foo = "foo" } + def check(result: Any) = assert(result == "foo", result.toString) + + val s = new test.C1 + check(s.O.struct(fooable)) + check(test.O1.O.struct(fooable)) + check(test.O2.O.struct(fooable)) +} |