diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-07-12 19:23:26 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-07-12 19:23:26 +1000 |
commit | 0b19aba1b9636c0f092c316892f55f1f8b4bd94e (patch) | |
tree | 32142ffce075b1abe8081b8f416f87062cf1e700 | |
parent | b92c3aff1ab8c76c4816bd7b1a82a0f87d787837 (diff) | |
download | scala-0b19aba1b9636c0f092c316892f55f1f8b4bd94e.tar.gz scala-0b19aba1b9636c0f092c316892f55f1f8b4bd94e.tar.bz2 scala-0b19aba1b9636c0f092c316892f55f1f8b4bd94e.zip |
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.
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala | 21 | ||||
-rw-r--r-- | test/files/pos/t9393/Named.java | 3 | ||||
-rw-r--r-- | test/files/pos/t9393/NamedImpl.java | 15 | ||||
-rw-r--r-- | test/files/pos/t9393/test.scala | 3 |
4 files changed, 32 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala index 7f0aaa7305..150f38d6ec 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala @@ -841,16 +841,17 @@ abstract class BTypes { assert(!ClassBType.isInternalPhantomType(internalName), s"Cannot create ClassBType for phantom type $this") - assert( - if (info.get.superClass.isEmpty) { isJLO(this) || (isCompilingPrimitive && ClassBType.hasNoSuper(internalName)) } - else if (isInterface.get) isJLO(info.get.superClass.get) - else !isJLO(this) && ifInit(info.get.superClass.get)(!_.isInterface.get), - s"Invalid superClass in $this: ${info.get.superClass}" - ) - assert( - info.get.interfaces.forall(c => ifInit(c)(_.isInterface.get)), - s"Invalid interfaces in $this: ${info.get.interfaces}" - ) + // TODO bring these back in a way that doesn't trip pos/t9393 + // assert( + // if (info.get.superClass.isEmpty) { isJLO(this) || (isCompilingPrimitive && ClassBType.hasNoSuper(internalName)) } + // else if (isInterface.get) isJLO(info.get.superClass.get) + // else !isJLO(this) && ifInit(info.get.superClass.get)(!_.isInterface.get), + // s"Invalid superClass in $this: ${info.get.superClass}" + // ) + // assert( + // info.get.interfaces.forall(c => ifInit(c)(_.isInterface.get)), + // s"Invalid interfaces in $this: ${info.get.interfaces}" + // ) assert(info.get.nestedClasses.forall(c => ifInit(c)(_.isNestedClass.get)), info.get.nestedClasses) } diff --git a/test/files/pos/t9393/Named.java b/test/files/pos/t9393/Named.java new file mode 100644 index 0000000000..144ddbf26e --- /dev/null +++ b/test/files/pos/t9393/Named.java @@ -0,0 +1,3 @@ +package bug; + +public @interface Named {} diff --git a/test/files/pos/t9393/NamedImpl.java b/test/files/pos/t9393/NamedImpl.java new file mode 100644 index 0000000000..7918739c2b --- /dev/null +++ b/test/files/pos/t9393/NamedImpl.java @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com> + */ +package bug; + +import bug.Named; +import java.io.Serializable; +import java.lang.annotation.Annotation; + +public class NamedImpl implements Named { + + public Class<? extends Annotation> annotationType() { + return null; + } +} diff --git a/test/files/pos/t9393/test.scala b/test/files/pos/t9393/test.scala new file mode 100644 index 0000000000..4df0476c98 --- /dev/null +++ b/test/files/pos/t9393/test.scala @@ -0,0 +1,3 @@ +class C { + new bug.NamedImpl +} |