From 9f87127c40a2b8ac0c8f97d039053e4d2f7577e4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 13 Dec 2014 19:15:47 +0100 Subject: Disable implicit conversions between from `Null` and `Nothing`. This is necessary to reject code like val x: Boolean = null Without the restriction, this code would typecheck and expand to val x: Boolean = Predef.Boolean2boolean(null) since `null` counts as a value of type `java.kang.Boolean`. --- test/dotc/tests.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index f5072be96..4de8df8ad 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -108,6 +108,7 @@ class tests extends CompilerTest { @Test def neg_boundspropagation = compileFile(negDir, "boundspropagation", xerrors = 4) @Test def neg_refinedSubtyping = compileFile(negDir, "refinedSubtyping", xerrors = 2) @Test def neg_i0248_inherit_refined = compileFile(negDir, "i0248-inherit-refined", xerrors = 4) + @Test def neg_i0281 = compileFile(negDir, "i0281-null-primitive-conforms", xerrors = 3) @Test def dotc = compileDir(dotcDir + "tools/dotc", twice)(allowDeepSubtypes) @Test def dotc_ast = compileDir(dotcDir + "tools/dotc/ast", twice) -- cgit v1.2.3