Last active
August 29, 2015 14:02
-
-
Save davegurnell/e7e041c2a13459fc1659 to your computer and use it in GitHub Desktop.
Scala macro / for comprehension issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox.Context | |
object PrintForMacros { | |
def printFor[A](expr: A): A = | |
macro PrintForMacros.printForMacro[A] | |
} | |
class PrintForMacros(val c: Context) { | |
import c.universe._ | |
def printForMacro[A: c.WeakTypeTag](expr: c.Tree) = expr match { | |
case q"for (..$enums) yield $body" => | |
q"for (..$enums) yield $body" | |
case q"for (..$enums) $body" => | |
q"for (..$enums) $body" | |
case other => | |
c.abort(c.enclosingPosition, "argument must be a for-comprehension") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object PrintForApp extends App { | |
import PrintForMacros.printFor | |
val option1 = Some(1) | |
val option2 = Some(2) | |
println(printFor { | |
for { | |
a <- option1 | |
b <- option2 | |
} yield a + b | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> printfor/run | |
[warn] Binary version (2.11.0-M4) for dependency org.scala-lang#scala-parser-combinators;2.11.0-M4 | |
[warn] in printforlib#printforlib_2.11;0.1-SNAPSHOT differs from Scala binary version in project (2.11). | |
[info] Compiling 1 Scala source to /Users/dave/dev/projects/core-macros/code/printfor/lib/target/scala-2.11/classes... | |
[info] Compiling 1 Scala source to /Users/dave/dev/projects/core-macros/code/printfor/app/target/scala-2.11/classes... | |
[error] symbol value a does not exist in PrintForApp.delayedEndpoint$PrintForApp$1 | |
[trace] Stack trace suppressed: run last printfor/compile:compile for the full output. | |
[error] (printfor/compile:compile) scala.reflect.internal.FatalError: | |
[error] symbol value a does not exist in PrintForApp.delayedEndpoint$PrintForApp$1 | |
[error] while compiling: /Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala | |
[error] during phase: icode | |
[error] library version: version 2.11.0 | |
[error] compiler version: version 2.11.0 | |
[error] reconstructed args: -classpath /Users/dave/dev/projects/core-macros/code/printfor/app/target/scala-2.11/classes:/Users/dave/dev/projects/core-macros/code/printfor/lib/target/scala-2.11/classes:/Users/dave/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0.jar:/Users/dave/.ivy2/cache/org.scala-lang/scala-parser-combinators/jars/scala-parser-combinators-2.11.0-M4.jar -deprecation -feature -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/dave/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.0.jar | |
[error] | |
[error] last tree to typer: This(object PrintForApp) | |
[error] tree position: line 1 of /Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala | |
[error] tree tpe: PrintForApp.type | |
[error] symbol: object PrintForApp | |
[error] symbol definition: class PrintForApp extends App (a ModuleClassSymbol) | |
[error] symbol package: <empty> | |
[error] symbol owners: object PrintForApp | |
[error] call site: constructor PrintForApp$delayedInit$body in class PrintForApp$delayedInit$body in package <empty> | |
[error] | |
[error] == Source file context for tree position == | |
[error] | |
[error] 0 object PrintForApp extends App { | |
[error] 1 import PrintForMacros._ | |
[error] 2 | |
[error] 3 val option1 = Some(1) | |
[error] 4 val option2 = Some(2) | |
[error] 5 | |
[error] 6 println(printFor { | |
[error] Total time: 1 s, completed Jun 6, 2014 7:20:26 PM | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> last | |
[debug] Running task... Cancelable: false, check cycles: false | |
[debug] Other repositories: | |
[debug] FileRepository(publish-m2-local,FileConfiguration(true,None),Patterns(ivyPatterns=List(), artifactPatterns=List(/Users/dave/.m2/repository/[organisation]/[module](_[scalaVersion])(_[sbtVersion])/[revision]/[artifact]-[revision](-[classifier]).[ext]), isMavenCompatible=true)) | |
[debug] Default repositories: | |
[debug] Raw(ProjectResolver(inter-project, mapped: )) | |
[debug] FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false)) | |
[debug] public: http://repo1.maven.org/maven2/ | |
[debug] Using inline dependencies specified in Scala. | |
[warn] Binary version (2.11.0-M4) for dependency org.scala-lang#scala-parser-combinators;2.11.0-M4 | |
[warn] in printforlib#printforlib_2.11;0.1-SNAPSHOT differs from Scala binary version in project (2.11). | |
[debug] | |
[debug] Initial source changes: | |
[debug] removed:Set() | |
[debug] added: Set() | |
[debug] modified: Set(/Users/dave/dev/projects/core-macros/code/printfor/lib/src/main/scala/PrintForMacros.scala) | |
[debug] Removed products: Set() | |
[debug] Modified external sources: Set() | |
[debug] Modified binary dependencies: Set() | |
[debug] Initial directly invalidated sources: Set(/Users/dave/dev/projects/core-macros/code/printfor/lib/src/main/scala/PrintForMacros.scala) | |
[debug] | |
[debug] Sources indirectly invalidated by: | |
[debug] product: Set() | |
[debug] binary dep: Set() | |
[debug] external source: Set() | |
[debug] All initially invalidated sources: Set(/Users/dave/dev/projects/core-macros/code/printfor/lib/src/main/scala/PrintForMacros.scala) | |
[debug] Recompiling all 1 sources: invalidated sources (1) exceeded 50.0% of all sources | |
[info] Compiling 1 Scala source to /Users/dave/dev/projects/core-macros/code/printfor/lib/target/scala-2.11/classes... | |
[debug] Getting compiler-interface from component compiler for Scala 2.11.0 | |
[debug] Other repositories: | |
[debug] Default repositories: | |
[debug] FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false)) | |
[debug] Getting compiler-interface from component compiler for Scala 2.11.0 | |
[debug] Other repositories: | |
[debug] Default repositories: | |
[debug] FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false)) | |
[debug] Running cached compiler 3ee3799f, interfacing (CompilerInterface) with Scala compiler version 2.11.0 | |
[debug] Calling Scala compiler with arguments (CompilerInterface): | |
[debug] -deprecation | |
[debug] -feature | |
[debug] -bootclasspath | |
[debug] /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/dave/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.0.jar | |
[debug] -classpath | |
[debug] /Users/dave/dev/projects/core-macros/code/printfor/lib/target/scala-2.11/classes:/Users/dave/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0.jar:/Users/dave/.ivy2/cache/org.scala-lang/scala-parser-combinators/jars/scala-parser-combinators-2.11.0-M4.jar | |
[debug] Scala compilation took 0.42788 s | |
[debug] Invalidated by transitive public inheritance: Set(/Users/dave/dev/projects/core-macros/code/printfor/lib/src/main/scala/PrintForMacros.scala) | |
[debug] Invalidated by direct dependency: Set() | |
[debug] New invalidations: | |
[debug] Set() | |
[debug] Previously invalidated, but (transitively) depend on new invalidations: | |
[debug] Set() | |
[debug] Copy resource mappings: | |
[debug] | |
[debug] | |
[debug] Initial source changes: | |
[debug] removed:Set() | |
[debug] added: Set() | |
[debug] modified: Set(/Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala) | |
[debug] Removed products: Set() | |
[debug] Modified external sources: Set(PrintForMacros$) | |
[debug] Modified binary dependencies: Set() | |
[debug] Initial directly invalidated sources: Set(/Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala) | |
[debug] | |
[debug] Sources indirectly invalidated by: | |
[debug] product: Set() | |
[debug] binary dep: Set() | |
[debug] external source: Set(/Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala) | |
[debug] All initially invalidated sources: Set(/Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala) | |
[debug] Recompiling all 1 sources: invalidated sources (1) exceeded 50.0% of all sources | |
[info] Compiling 1 Scala source to /Users/dave/dev/projects/core-macros/code/printfor/app/target/scala-2.11/classes... | |
[debug] Getting compiler-interface from component compiler for Scala 2.11.0 | |
[debug] Other repositories: | |
[debug] Default repositories: | |
[debug] FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false)) | |
[debug] Getting compiler-interface from component compiler for Scala 2.11.0 | |
[debug] Other repositories: | |
[debug] Default repositories: | |
[debug] FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false)) | |
[debug] Running cached compiler 64284a59, interfacing (CompilerInterface) with Scala compiler version 2.11.0 | |
[debug] Calling Scala compiler with arguments (CompilerInterface): | |
[debug] -deprecation | |
[debug] -feature | |
[debug] -bootclasspath | |
[debug] /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/dave/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.0.jar | |
[debug] -classpath | |
[debug] /Users/dave/dev/projects/core-macros/code/printfor/app/target/scala-2.11/classes:/Users/dave/dev/projects/core-macros/code/printfor/lib/target/scala-2.11/classes:/Users/dave/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0.jar:/Users/dave/.ivy2/cache/org.scala-lang/scala-parser-combinators/jars/scala-parser-combinators-2.11.0-M4.jar | |
[error] symbol value a does not exist in PrintForApp.delayedEndpoint$PrintForApp$1 | |
scala.reflect.internal.FatalError: | |
symbol value a does not exist in PrintForApp.delayedEndpoint$PrintForApp$1 | |
while compiling: /Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala | |
during phase: icode | |
library version: version 2.11.0 | |
compiler version: version 2.11.0 | |
reconstructed args: -classpath /Users/dave/dev/projects/core-macros/code/printfor/app/target/scala-2.11/classes:/Users/dave/dev/projects/core-macros/code/printfor/lib/target/scala-2.11/classes:/Users/dave/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0.jar:/Users/dave/.ivy2/cache/org.scala-lang/scala-parser-combinators/jars/scala-parser-combinators-2.11.0-M4.jar -deprecation -feature -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/dave/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.0.jar | |
last tree to typer: This(object PrintForApp) | |
tree position: line 1 of /Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala | |
tree tpe: PrintForApp.type | |
symbol: object PrintForApp | |
symbol definition: class PrintForApp extends App (a ModuleClassSymbol) | |
symbol package: <empty> | |
symbol owners: object PrintForApp | |
call site: constructor PrintForApp$delayedInit$body in class PrintForApp$delayedInit$body in package <empty> | |
== Source file context for tree position == | |
0 object PrintForApp extends App { | |
1 import PrintForMacros._ | |
2 | |
3 val option1 = Some(1) | |
4 val option2 = Some(2) | |
5 | |
6 println(printFor { | |
at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:58) | |
at scala.tools.nsc.Global.abort(Global.scala:269) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIdent$1(GenICode.scala:883) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:889) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1131) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1129) | |
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110) | |
at scala.collection.immutable.List.foldLeft(List.scala:83) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1129) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply3$1(GenICode.scala:695) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:705) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:922) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:914) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1131) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1129) | |
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110) | |
at scala.collection.immutable.List.foldLeft(List.scala:83) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1129) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply6$1(GenICode.scala:776) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:807) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:922) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1131) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1129) | |
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110) | |
at scala.collection.immutable.List.foldLeft(List.scala:83) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1129) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply6$1(GenICode.scala:776) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:807) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:179) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:153) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:153) | |
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110) | |
at scala.collection.immutable.List.foldLeft(List.scala:83) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:913) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:121) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:146) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:96) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:87) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:65) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:61) | |
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:430) | |
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:397) | |
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:397) | |
at scala.collection.Iterator$class.foreach(Iterator.scala:743) | |
at scala.collection.AbstractIterator.foreach(Iterator.scala:1174) | |
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:397) | |
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:53) | |
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1625) | |
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1610) | |
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1605) | |
at scala.tools.nsc.Global$Run.compile(Global.scala:1703) | |
at xsbt.CachedCompiler0.run(CompilerInterface.scala:123) | |
at xsbt.CachedCompiler0.run(CompilerInterface.scala:99) | |
at xsbt.CompilerInterface.run(CompilerInterface.scala:27) | |
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:102) | |
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:48) | |
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41) | |
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:98) | |
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:98) | |
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:98) | |
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:159) | |
at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:97) | |
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:142) | |
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:86) | |
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:38) | |
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:36) | |
at sbt.inc.Incremental$.cycle(Incremental.scala:73) | |
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:33) | |
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:32) | |
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:41) | |
at sbt.inc.Incremental$.compile(Incremental.scala:32) | |
at sbt.inc.IncrementalCompile$.apply(Compile.scala:26) | |
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:150) | |
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70) | |
at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:45) | |
at sbt.Compiler$.apply(Compiler.scala:70) | |
at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:722) | |
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:716) | |
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:716) | |
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) | |
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42) | |
at sbt.std.Transform$$anon$4.work(System.scala:64) | |
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237) | |
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237) | |
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) | |
at sbt.Execute.work(Execute.scala:244) | |
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237) | |
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237) | |
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160) | |
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30) | |
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) | |
at java.util.concurrent.FutureTask.run(FutureTask.java:138) | |
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) | |
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) | |
at java.util.concurrent.FutureTask.run(FutureTask.java:138) | |
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) | |
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) | |
at java.lang.Thread.run(Thread.java:695) | |
[error] (printfor/compile:compile) scala.reflect.internal.FatalError: | |
[error] symbol value a does not exist in PrintForApp.delayedEndpoint$PrintForApp$1 | |
[error] while compiling: /Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala | |
[error] during phase: icode | |
[error] library version: version 2.11.0 | |
[error] compiler version: version 2.11.0 | |
[error] reconstructed args: -classpath /Users/dave/dev/projects/core-macros/code/printfor/app/target/scala-2.11/classes:/Users/dave/dev/projects/core-macros/code/printfor/lib/target/scala-2.11/classes:/Users/dave/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.0.jar:/Users/dave/.ivy2/cache/org.scala-lang/scala-parser-combinators/jars/scala-parser-combinators-2.11.0-M4.jar -deprecation -feature -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/dave/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.0.jar | |
[error] | |
[error] last tree to typer: This(object PrintForApp) | |
[error] tree position: line 1 of /Users/dave/dev/projects/core-macros/code/printfor/app/src/main/scala/PrintForApp.scala | |
[error] tree tpe: PrintForApp.type | |
[error] symbol: object PrintForApp | |
[error] symbol definition: class PrintForApp extends App (a ModuleClassSymbol) | |
[error] symbol package: <empty> | |
[error] symbol owners: object PrintForApp | |
[error] call site: constructor PrintForApp$delayedInit$body in class PrintForApp$delayedInit$body in package <empty> | |
[error] | |
[error] == Source file context for tree position == | |
[error] | |
[error] 0 object PrintForApp extends App { | |
[error] 1 import PrintForMacros._ | |
[error] 2 | |
[error] 3 val option1 = Some(1) | |
[error] 4 val option2 = Some(2) | |
[error] 5 | |
[error] 6 println(printFor { | |
[error] Total time: 1 s, completed Jun 6, 2014 7:20:26 PM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment