From 046376e48bd3c4a294cef239a6cc77a61b62bc6e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 13 Apr 2015 15:47:54 +0200 Subject: Added phase to check `New` nodes for instantiability. - Abstract classes cannot be instantiated (exceptions: parent news and Java annotations) - Instantiateed class must conform to its self type. --- test/dotc/tests.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'test/dotc/tests.scala') diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index c3f501a52..b9ed6fb03 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -126,6 +126,7 @@ class tests extends CompilerTest { @Test def neg_i0281 = compileFile(negDir, "i0281-null-primitive-conforms", xerrors = 3) @Test def neg_moduleSubtyping = compileFile(negDir, "moduleSubtyping", xerrors = 4) @Test def neg_escapingRefs = compileFile(negDir, "escapingRefs", xerrors = 2) + @Test def neg_instantiateAbstract = compileFile(negDir, "instantiateAbstract", xerrors = 8) @Test def neg_selfInheritance = compileFile(negDir, "selfInheritance", xerrors = 5) @Test def dotc = compileDir(dotcDir + "tools/dotc", failedOther)(allowDeepSubtypes ++ twice) // see dotc_core -- cgit v1.2.3