diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-16 15:27:50 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-21 11:24:03 +0100 |
commit | bb90b26fbca27f432ade46ae572b82e1b8027b19 (patch) | |
tree | 20da120bf3790ab18a9b6d8c02e44e682418db1c /tests/pos/t0227.scala | |
parent | a7d47ab54cbfb324dec4ee1594e24738cd54113a (diff) | |
download | dotty-bb90b26fbca27f432ade46ae572b82e1b8027b19.tar.gz dotty-bb90b26fbca27f432ade46ae572b82e1b8027b19.tar.bz2 dotty-bb90b26fbca27f432ade46ae572b82e1b8027b19.zip |
Tests t01xx and t02xx
Test t0288 moved to disabled due to lack of Java interop.
Test t0273 fixed by relaxing double def condition: We only regard two
definitions that define the same name and have exactly the same signature
as double definitions. Previously, signatures that defined the same parameters
were also excluded.
Diffstat (limited to 'tests/pos/t0227.scala')
-rw-r--r-- | tests/pos/t0227.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/pos/t0227.scala b/tests/pos/t0227.scala new file mode 100644 index 000000000..806b20d40 --- /dev/null +++ b/tests/pos/t0227.scala @@ -0,0 +1,31 @@ +final class Settings { + def f[T](a_args: T*): List[T] = Nil +} + +abstract class Factory { + type libraryType <: Base + + final def apply(settings: Settings): libraryType = sys.error("bla") +} + +abstract class Base { + val settings: Settings + + protected val demands: List[Factory] = Nil +} + +class SA(val settings: Settings) extends Base { + override val demands = List( + SD + ) ::: settings.f( + SC + ) +} + +object SC extends Factory { + type libraryType = Base +} + +object SD extends Factory { + type libraryType = SA +} |