aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2014-12-13 17:52:53 +0100
committerodersky <odersky@gmail.com>2014-12-13 17:52:53 +0100
commitf3d887f079efbe7dbb53abd22bd212eee8e1c67a (patch)
tree82f0ec11b9d6837f495e60bf345112907053f680 /tests
parent1466e88efacd7247d426974160fd8968f8921b0b (diff)
parent35ba97ca7ac92761cad1a0be43fbe52d9bcb3c92 (diff)
downloaddotty-f3d887f079efbe7dbb53abd22bd212eee8e1c67a.tar.gz
dotty-f3d887f079efbe7dbb53abd22bd212eee8e1c67a.tar.bz2
dotty-f3d887f079efbe7dbb53abd22bd212eee8e1c67a.zip
Merge pull request #277 from dotty-staging/change/drop-not-null
Change/drop not null
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/i262-null-subtyping.scala19
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
+}