diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-12-03 18:34:18 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-12-03 19:19:59 +0100 |
commit | ff9cfd9eb7f47be69d302f73de08a00303249a0d (patch) | |
tree | 53c628d274744bde211727b34677bd1fa5e82a4b /test/files | |
parent | 4b2330b3d3db4263a8b1e19b792596dd60d79045 (diff) | |
download | scala-ff9cfd9eb7f47be69d302f73de08a00303249a0d.tar.gz scala-ff9cfd9eb7f47be69d302f73de08a00303249a0d.tar.bz2 scala-ff9cfd9eb7f47be69d302f73de08a00303249a0d.zip |
Don't return unimportables from importedSymbol.
Hardening against the symptom of SI-6745, which yielded:
wat.scala:4: error: too many arguments for constructor Predef: ()object Predef
def this() = this(0)
^
The fix for the underlying problem in that bug
has been targetted at branch 2.10.x.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t6745-2.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/t6745-2.scala b/test/files/run/t6745-2.scala new file mode 100644 index 0000000000..31ecd42bd1 --- /dev/null +++ b/test/files/run/t6745-2.scala @@ -0,0 +1,22 @@ +import scala.tools.nsc._ +import scala.tools.partest.CompilerTest +import scala.collection.{ mutable, immutable, generic } + +object Test extends CompilerTest { + import global._ + import rootMirror._ + import definitions._ + import global.analyzer.{Context, ImportInfo} + + override def code = """ +package context { +} + """ + + def check(source: String, unit: global.CompilationUnit) = { + val context: Context = global.analyzer.rootContext(unit) + val importInfo: ImportInfo = context.imports.head // Predef._ + val importedSym = importInfo.importedSymbol(nme.CONSTRUCTOR) + assert(importedSym == NoSymbol, importedSym) // was "constructor Predef" + } +} |