Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro call can not be chained because of missing symbol #7245

Open
scabug opened this issue Mar 12, 2013 · 1 comment
Open

Macro call can not be chained because of missing symbol #7245

scabug opened this issue Mar 12, 2013 · 1 comment
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Mar 12, 2013

I have no clue about what's going wrong in my macrogen project you can find at
https://github.com/leonardschneider/macrogen

Trying to chain to macro calls throws a compiler exception due to missing symbol.

Here is how to reproduce the issue.

Welcome to Scala version 2.11.0-20130223-173205-ef24a8b53c (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_43).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import macrogen.TupleImplicit._
import macrogen.TupleImplicit._

scala> (1,2) :+ 3
res0: (Int, Int, Int) = (1,2,3)

scala> (1,2) :+ 3 :+ 4
ReplGlobal.abort: symbol value tup does not exist in $line5.$read$$iw$$iw$$iw$$iw.<init>
error: symbol value tup does not exist in <init>
error: uncaught exception during compilation: FatalError("
     while compiling: <console>
        during phase: icode
     library version: version 2.11.0-20130223-173205-ef24a8b53c
    compiler version: version 2.11.0-20130223-173205-ef24a8b53c
  reconstructed args: -classpath /Users/leo/src/macrogen/target/scala-2.11/classes:/Users/leo/.ivy2/cache/org.scala-lang.macro-paradise/scala-reflect/jars/scala-reflect-2.11.0-SNAPSHOT.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/scala-compiler.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/jline.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/scala-reflect.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/jansi.jar -deprecation -bootclasspath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/scala-library.jar -feature -unchecked -Yrepl-sync

  last tree to typer: Block
              symbol: null
   symbol definition: null
                 tpe: Tuple4
       symbol owners: 
      context owners: object iw -> package $line5

== Enclosing template or block ==

Template( // val <local $iw>: <notype>, tree.tpe=type
  "java.lang.Object" // parents
  ValDef(
    private
    "_"
    <tpt>
    <empty>
  )
  DefDef( // def <init>(): type
    <method>
    "<init>"
    []
    List(Nil)
    <tpt> // tree.tpe=type
    Block( // tree.tpe=Unit
      Apply( // def <init>(): Object in class Object, tree.tpe=Object
        $read$super."<init>" // def <init>(): Object in class Object, tree.tpe=()Object
        Nil
      )
      ()
    )
  )
)

== Expanded type of tree ==

TypeRef(
  TypeSymbol(
    case class Tuple4 extends Product4 with Product with Serializable
  )
)

symbol value tup does not exist in <init>") @ scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:52)
scala.reflect.internal.FatalError: 
     while compiling: <console>
        during phase: icode
     library version: version 2.11.0-20130223-173205-ef24a8b53c
    compiler version: version 2.11.0-20130223-173205-ef24a8b53c
  reconstructed args: -classpath /Users/leo/src/macrogen/target/scala-2.11/classes:/Users/leo/.ivy2/cache/org.scala-lang.macro-paradise/scala-reflect/jars/scala-reflect-2.11.0-SNAPSHOT.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/scala-compiler.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/jline.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/scala-reflect.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/jansi.jar -deprecation -bootclasspath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar:/Users/leo/.sbt/boot/org.scala-lang.macro-paradise.scala-2.11.0-SNAPSHOT/lib/scala-library.jar -feature -unchecked -Yrepl-sync

  last tree to typer: Block
              symbol: null
   symbol definition: null
                 tpe: Tuple4
       symbol owners: 
      context owners: object iw -> package $line5

== Enclosing template or block ==

Template( // val <local $iw>: <notype>, tree.tpe=type
  "java.lang.Object" // parents
  ValDef(
    private
    "_"
    <tpt>
    <empty>
  )
  DefDef( // def <init>(): type
    <method>
    "<init>"
    []
    List(Nil)
    <tpt> // tree.tpe=type
    Block( // tree.tpe=Unit
      Apply( // def <init>(): Object in class Object, tree.tpe=Object
        $read$$iw.super."<init>" // def <init>(): Object in class Object, tree.tpe=()Object
        Nil
      )
      ()
    )
  )
)

== Expanded type of tree ==

TypeRef(
  TypeSymbol(
    case class Tuple4 extends Product4 with Product with Serializable
  )
)

symbol value tup does not exist in $line5.$read$$iw$$iw$$iw$$iw.<init>
	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:52)
	at scala.tools.nsc.Global.abort(Global.scala:252)
	at scala.tools.nsc.interpreter.IMain$$anon$2.scala$tools$nsc$interpreter$ReplGlobal$$super$abort(IMain.scala:248)
	at scala.tools.nsc.interpreter.ReplGlobal$class.abort(ReplGlobal.scala:20)
	at scala.tools.nsc.interpreter.IMain$$anon$2.abort(IMain.scala:248)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIdent$1(GenICode.scala:880)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:886)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1111)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1109)
	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110)
	at scala.collection.immutable.List.foldLeft(List.scala:84)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1109)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply3$1(GenICode.scala:689)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:699)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:911)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(GenICode.scala:1070)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply6$1(GenICode.scala:769)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:804)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(GenICode.scala:1070)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply1$1(GenICode.scala:605)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:630)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadValDef$1(GenICode.scala:518)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:526)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:180)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:154)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:154)
	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110)
	at scala.collection.immutable.List.foldLeft(List.scala:84)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:910)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:169)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:154)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:154)
	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110)
	at scala.collection.immutable.List.foldLeft(List.scala:84)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:910)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:122)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:70)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:147)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:97)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:70)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:88)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:66)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:62)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:412)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:379)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:379)
	at scala.collection.Iterator$class.foreach(Iterator.scala:725)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1156)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:379)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:55)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1507)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1482)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1478)
	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:410)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:748)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:708)
	at scala.tools.nsc.interpreter.IMain$Request.compile$lzycompute(IMain.scala:852)
	at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:847)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:573)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:538)
	at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:567)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:612)
	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:524)
	at scala.tools.nsc.interpreter.ILoop.processLine(ILoop.scala:380)
	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:397)
	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:680)
	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:666)
	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:666)
	at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:95)
	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:666)
	at scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:688)
	at xsbt.ConsoleInterface.run(ConsoleInterface.scala:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:73)
	at sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:64)
	at sbt.Console.console0$1(Console.scala:23)
	at sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala:24)
	at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
	at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)

That entry seems to have slain the compiler.  Shall I replay
your session? I can re-run each line except the last one.
[y/n]
Abandoning crashed session.
@scabug
Copy link
Author

scabug commented Mar 12, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7245?orig=1
Reporter: Leonard Schneider (leonard.schneider)
Affected Versions: 2.11.0-M4

@scabug scabug added the macros label Apr 7, 2017
@scabug scabug added this to the Backlog milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants