diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-13 11:33:26 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-12-13 11:33:31 +0100 |
commit | 179b9cc31552408c01928e1fca0e0af2a7453843 (patch) | |
tree | a06a049da3c51a942a8c591d8a152866af411c28 /tests | |
parent | 7cdf3d0dc5709634825b1300d77d1a0ef01c69fa (diff) | |
download | dotty-179b9cc31552408c01928e1fca0e0af2a7453843.tar.gz dotty-179b9cc31552408c01928e1fca0e0af2a7453843.tar.bz2 dotty-179b9cc31552408c01928e1fca0e0af2a7453843.zip |
Fix subtyping of null and refined types.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/i262-null-subtyping.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pos/i262-null-subtyping.scala b/tests/pos/i262-null-subtyping.scala new file mode 100644 index 000000000..284be49e8 --- /dev/null +++ b/tests/pos/i262-null-subtyping.scala @@ -0,0 +1,19 @@ +object O { + // This compiles + val a: { type T } = null; + val b: Any { type T } = null; + + // This doesn't: + // found : Null + // required: AnyRef{T} + val c: AnyRef { type T } = null; + + class A + class B + + val d: A & B = null + val e: A | B = null + + val f: (A & B) { def toString: String } = null + val g: (A | B) { def toString: String } = null +} |