From fcd0998f1e0f2307e9b0cbae6bf2c36234ca8d17 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 14 Oct 2011 02:16:17 +0000 Subject: Better error when abstract methods are missing. When many methods are missing, print a list of signatures the way they need to be implemented, and throw in ??? stub implementations so it should be compilable code. If anyone would like this logic exposed more generally (for the IDE or whatever) just let me know. No review. --- test/files/neg/t2213.check | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'test/files/neg/t2213.check') diff --git a/test/files/neg/t2213.check b/test/files/neg/t2213.check index f59503ee2a..9fb3bb2eb7 100644 --- a/test/files/neg/t2213.check +++ b/test/files/neg/t2213.check @@ -1,15 +1,25 @@ t2213.scala:9: error: class C needs to be abstract, since: -value y in class A of type Int is not defined -value x in class A of type Int is not defined -method g in class A of type => Int is not defined -method f in class A of type => Int is not defined +it has 4 unimplemented members. +/** As seen from class C, the missing signatures are as follows. + * For convenience, these are usable as stub implementations. + */ + def f: Int = ??? + def g: Int = ??? + val x: Int = ??? + val y: Int = ??? + class C extends A {} ^ t2213.scala:11: error: object creation impossible, since: -value y in class A of type Int is not defined -value x in class A of type Int is not defined -method g in class A of type => Int is not defined -method f in class A of type => Int is not defined +it has 4 unimplemented members. +/** As seen from object Q, the missing signatures are as follows. + * For convenience, these are usable as stub implementations. + */ + def f: Int = ??? + def g: Int = ??? + val x: Int = ??? + val y: Int = ??? + object Q extends A { } ^ two errors found -- cgit v1.2.3