Skip to content

Commit 0b19aba

Browse files
committed
SI-9393 Temporarily disable two assertions in GenBCode
These cause a crash in the build of Play. We should try to bring these back once we have suitable annotation awareness. Perhaps they should only be `devWarning`-s, though.
1 parent b92c3af commit 0b19aba

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -841,16 +841,17 @@ abstract class BTypes {
841841

842842
assert(!ClassBType.isInternalPhantomType(internalName), s"Cannot create ClassBType for phantom type $this")
843843

844-
assert(
845-
if (info.get.superClass.isEmpty) { isJLO(this) || (isCompilingPrimitive && ClassBType.hasNoSuper(internalName)) }
846-
else if (isInterface.get) isJLO(info.get.superClass.get)
847-
else !isJLO(this) && ifInit(info.get.superClass.get)(!_.isInterface.get),
848-
s"Invalid superClass in $this: ${info.get.superClass}"
849-
)
850-
assert(
851-
info.get.interfaces.forall(c => ifInit(c)(_.isInterface.get)),
852-
s"Invalid interfaces in $this: ${info.get.interfaces}"
853-
)
844+
// TODO bring these back in a way that doesn't trip pos/t9393
845+
// assert(
846+
// if (info.get.superClass.isEmpty) { isJLO(this) || (isCompilingPrimitive && ClassBType.hasNoSuper(internalName)) }
847+
// else if (isInterface.get) isJLO(info.get.superClass.get)
848+
// else !isJLO(this) && ifInit(info.get.superClass.get)(!_.isInterface.get),
849+
// s"Invalid superClass in $this: ${info.get.superClass}"
850+
// )
851+
// assert(
852+
// info.get.interfaces.forall(c => ifInit(c)(_.isInterface.get)),
853+
// s"Invalid interfaces in $this: ${info.get.interfaces}"
854+
// )
854855

855856
assert(info.get.nestedClasses.forall(c => ifInit(c)(_.isNestedClass.get)), info.get.nestedClasses)
856857
}

test/files/pos/t9393/Named.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package bug;
2+
3+
public @interface Named {}

test/files/pos/t9393/NamedImpl.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
3+
*/
4+
package bug;
5+
6+
import bug.Named;
7+
import java.io.Serializable;
8+
import java.lang.annotation.Annotation;
9+
10+
public class NamedImpl implements Named {
11+
12+
public Class<? extends Annotation> annotationType() {
13+
return null;
14+
}
15+
}

test/files/pos/t9393/test.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class C {
2+
new bug.NamedImpl
3+
}

0 commit comments

Comments
 (0)