From a7aeddd038bead9cda67a85a922a7988b459ff04 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 26 Jan 2012 06:58:17 -0800 Subject: Fix for recently induced -optimise crasher. "Induced" but not in my estimation "caused". Would like to understand why the enclosed test case crashes under -optimise without this change to AddInterfaces. --- test/files/pos/trait-force-info.flags | 1 + test/files/pos/trait-force-info.scala | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/files/pos/trait-force-info.flags create mode 100644 test/files/pos/trait-force-info.scala (limited to 'test') diff --git a/test/files/pos/trait-force-info.flags b/test/files/pos/trait-force-info.flags new file mode 100644 index 0000000000..eb4d19bcb9 --- /dev/null +++ b/test/files/pos/trait-force-info.flags @@ -0,0 +1 @@ +-optimise \ No newline at end of file diff --git a/test/files/pos/trait-force-info.scala b/test/files/pos/trait-force-info.scala new file mode 100644 index 0000000000..e01d225c84 --- /dev/null +++ b/test/files/pos/trait-force-info.scala @@ -0,0 +1,18 @@ +/** This does NOT crash unless it's in the interactive package. + */ + +package scala.tools.nsc +package interactive + +trait MyContextTrees { + val self: Global + val NoContext = self.analyzer.NoContext +} +// +// error: java.lang.AssertionError: assertion failed: trait Contexts.NoContext$ linkedModule: List() +// at scala.Predef$.assert(Predef.scala:160) +// at scala.tools.nsc.symtab.classfile.ClassfileParser$innerClasses$.innerSymbol$1(ClassfileParser.scala:1211) +// at scala.tools.nsc.symtab.classfile.ClassfileParser$innerClasses$.classSymbol(ClassfileParser.scala:1223) +// at scala.tools.nsc.symtab.classfile.ClassfileParser.classNameToSymbol(ClassfileParser.scala:489) +// at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$1(ClassfileParser.scala:757) +// at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$1(ClassfileParser.scala:789) -- cgit v1.2.3