@@ -56,16 +56,12 @@ class TreeChecker extends Phase with SymTransformer {
5656
5757 def isValidJVMMethodName (name : Name ) = name.toString.forall(isValidJVMMethodChar)
5858
59- def printError (str : String )(implicit ctx : Context ) = {
60- ctx.echo(Console .RED + " [error] " + Console .WHITE + str)
61- }
62-
6359 val NoSuperClass = Trait | Package
6460
6561 def testDuplicate (sym : Symbol , registry : mutable.Map [String , Symbol ], typ : String )(implicit ctx : Context ) = {
6662 val name = sym.fullName.mangledString
6763 if (this .flatClasses && registry.contains(name))
68- printError( s " $typ defined twice $sym ${sym.id} ${registry(name).id}" )
64+ assert( false , i " $typ defined twice $sym ${sym.id} ${registry(name).id}" )
6965 registry(name) = sym
7066 }
7167
@@ -85,14 +81,13 @@ class TreeChecker extends Phase with SymTransformer {
8581 if (sym.isClass && ! sym.isAbsent) {
8682 val validSuperclass = sym.isPrimitiveValueClass || defn.syntheticCoreClasses.contains(sym) ||
8783 (sym eq defn.ObjectClass ) || (sym is NoSuperClass ) || (sym.asClass.superClass.exists)
88- if (! validSuperclass)
89- printError(s " $sym has no superclass set " )
9084
85+ assert(validSuperclass, i " $sym has no superclass set " )
9186 testDuplicate(sym, seenClasses, " class" )
9287 }
9388
9489 if (sym.is(Method ) && sym.is(Deferred ) && sym.is(Private ))
95- assert(false , s " $sym is both Deferred and Private " )
90+ assert(false , i " $sym is both Deferred and Private " )
9691
9792 checkCompanion(symd)
9893
0 commit comments