From 3fb317560c7e1220cd51c7f8408cf3db6a84b290 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 19 May 2013 03:42:03 -0700 Subject: SI-7427 stop crashing under -Ydebug. Change "dumpClassesAndAbort" to "devWarning". You can witness it happen like so. % scalac test/files/pos/t7427.scala -Ydebug -Xdev ... [running phase cleanup on t7427.scala] [running phase icode on t7427.scala] warning: !!! PJUMP(method matchEnd4)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction warning: !!! PJUMP(method case6)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction [running phase inliner on t7427.scala] [running phase inlinehandlers on t7427.scala] Having now lived with this for months, I have no ambition to unravel the actual problem, I just want it to stop crashing. --- test/files/pos/t7427.flags | 1 + test/files/pos/t7427.scala | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 test/files/pos/t7427.flags create mode 100644 test/files/pos/t7427.scala (limited to 'test/files') diff --git a/test/files/pos/t7427.flags b/test/files/pos/t7427.flags new file mode 100644 index 0000000000..9c7d6400fc --- /dev/null +++ b/test/files/pos/t7427.flags @@ -0,0 +1 @@ +-Ydebug diff --git a/test/files/pos/t7427.scala b/test/files/pos/t7427.scala new file mode 100644 index 0000000000..cca52950d1 --- /dev/null +++ b/test/files/pos/t7427.scala @@ -0,0 +1,4 @@ +// Compiles with no options +// Compiles with -Ydebug -Ydisable-unreachable-prevention +// Crashes with -Ydebug +trait Bippy { 3 match { case 3 => } } -- cgit v1.2.3 From b6757e11a1970480a60741235fc86f01d8957e07 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 19 May 2013 09:43:04 -0700 Subject: An attempt to make tests deterministic. The nondeterminism presently showing itself in presentation/implicit-member is a consequence of the presentation compiler tests relying on details of the behavior of toString calls. We need to stomp this out, but it will take a while. Based on the check file changes enclosed with this commit, this will suffice for the presentation compiler tests. A broader assault will have to take place, but not yet. --- src/interactive/scala/tools/nsc/interactive/CompilerControl.scala | 5 +++++ .../scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala | 2 +- test/files/presentation/ide-bug-1000531.check | 2 +- test/files/presentation/implicit-member.check | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'test/files') diff --git a/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala b/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala index c38c7c8257..d036a6e853 100644 --- a/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala +++ b/src/interactive/scala/tools/nsc/interactive/CompilerControl.scala @@ -297,6 +297,11 @@ trait CompilerControl { self: Global => def implicitlyAdded = false private def accessible_s = if (accessible) "" else "[inaccessible] " + def forceInfoString = { + definitions.fullyInitializeSymbol(sym) + definitions.fullyInitializeType(tpe) + infoString + } def infoString = s"$accessible_s${sym.defStringSeenAs(tpe)}" } diff --git a/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala b/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala index 08d84af8f5..e28bf20745 100644 --- a/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala +++ b/src/interactive/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala @@ -27,7 +27,7 @@ private[tests] trait CoreTestDefs reporter.println("retrieved %d members".format(members.size)) compiler ask { () => val filtered = members.filterNot(member => (member.sym.name string_== "getClass") || member.sym.isConstructor) - reporter println (filtered.map(_.infoString).sorted mkString "\n") + reporter println (filtered.map(_.forceInfoString).sorted mkString "\n") } } } diff --git a/test/files/presentation/ide-bug-1000531.check b/test/files/presentation/ide-bug-1000531.check index 980bb0a25d..be8805330a 100644 --- a/test/files/presentation/ide-bug-1000531.check +++ b/test/files/presentation/ide-bug-1000531.check @@ -7,7 +7,7 @@ retrieved 124 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit [inaccessible] protected[this] def reversed: List[B] -class GroupedIterator[B <: ] extends AbstractIterator[Seq[B]] with Iterator[Seq[B]] +class GroupedIterator[B >: A] extends AbstractIterator[Seq[B]] with Iterator[Seq[B]] def +(other: String): String def ++[B >: B](that: => scala.collection.GenTraversableOnce[B]): Iterator[B] def ->[B](y: B): (java.util.Iterator[B], B) diff --git a/test/files/presentation/implicit-member.check b/test/files/presentation/implicit-member.check index 92d8e38abe..acf7e1a0fd 100644 --- a/test/files/presentation/implicit-member.check +++ b/test/files/presentation/implicit-member.check @@ -15,7 +15,7 @@ def formatted(fmtstr: String): String def hashCode(): Int def toString(): String def →[B](y: B): (Implicit.type, B) -final class AppliedImplicit[A <: ] extends AnyRef +final class AppliedImplicit[A] extends AnyRef final def !=(x$1: Any): Boolean final def !=(x$1: AnyRef): Boolean final def ##(): Int -- cgit v1.2.3