diff options
author | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-03-12 22:44:33 +0100 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-03-12 22:44:33 +0100 |
commit | 9ef5f6817688f814a3450126aa7383b0928e80a0 (patch) | |
tree | 5727a2f7f7fd665cefdb312af2785c692f04377c /tests/untried/pos/spec-simple.scala | |
parent | 194be919664447631ba55446eb4874979c908d27 (diff) | |
download | dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.gz dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.bz2 dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.zip |
add tests from scala/test/files/{pos,neg}
with explicit Unit return type
Diffstat (limited to 'tests/untried/pos/spec-simple.scala')
-rw-r--r-- | tests/untried/pos/spec-simple.scala | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/untried/pos/spec-simple.scala b/tests/untried/pos/spec-simple.scala new file mode 100644 index 000000000..19b660688 --- /dev/null +++ b/tests/untried/pos/spec-simple.scala @@ -0,0 +1,51 @@ +class Foo[@specialized T] { + var v: T = _ + + def foo(x: T): T = x + + println("abc") + + class Bar[@specialized U] { + def bar(x: U): T = v +// def barInt(x: Int): T = bar(x.asInstanceOf[U]) + } +} + +class Test { + def test: Unit = { + val a = new Foo[Int] + val b = new a.Bar[Int] + a.foo(10) + b.bar(11) + } +} + +/* +abstract class Foo[@specialized T] { + def foo(x: T): T + def foo$Int(x: Int): Int + + abstract class Bar[@specialized U] { + def bar(x: U): T + def bar$Int(x: Int): T + } + abstract class Bar$Int extends Bar[Int] { + def bar(x: Int): T = bar$Int(x) + def bar$Int(x: Int): T + } +} + +abstract class Foo$Int extends Foo[Int] { + def foo(x: Int): Int = foo$Int(x) + def foo$Int(x: Int): Int + + abstract class Bar[@specialized U] { + def bar(x: U): Int + def bar$Int(x: Int): Int + } + abstract class Bar$Int extends Bar[Int] { + def bar(x: Int): Int = bar$Int(x) + def bar$Int(x: Int): Int + } +} +*/ |