Comments (16)
This appears to be a bug in macro paradise. I reproduced it with this macro annotation:
package simulacrum
import scala.annotation.StaticAnnotation
import scala.language.experimental.macros
import scala.reflect.macros.whitebox.Context
class typeclass extends StaticAnnotation {
def macroTransform(annottees: Any*): Any = macro TypeClassMacros.generateTypeClass
}
object TypeClassMacros {
def generateTypeClass(c: Context)(annottees: c.Expr[Any]*): c.Expr[Any] = {
annottees.head
}
}
Compiling the following code results in the subsequent compiler crash:
@typeclass trait Semigroup[@specialized(Int, Long) A] {
def append(x: A, y: A): A
}
Crash:
[error] (test:compile) scala.reflect.internal.FatalError:
[error] EmptyScope.enter
[error] while compiling: typeclass.scala
[error] during phase: globalPhase=specialize, enteringPhase=explicitouter
[error] library version: version 2.11.5
[error] compiler version: version 2.11.5
[error] reconstructed args: -language:implicitConversions -language:higherKinds -deprecation -classpath...
[error]
[error] last tree to typer: term apply
[error] tree position: line 9 of typeclass.scala
[error] tree tpe: <notype>
[error] symbol: final method apply
[error] symbol definition: final def apply(): Unit (a MethodSymbol)
[error] symbol package: simulacrum
[error] symbol owners: method apply -> <$anon: () => Unit> -> value <local TypeClassTest> -> class TypeClassTest
[error] call site: constructor $anonfun in package simulacrum
at scala.reflect.internal.Reporting$class.abort(Reporting.scala:59)
at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:16)
at scala.reflect.internal.Scopes$EmptyScope$.enterEntry(Scopes.scala:460)
at scala.reflect.internal.Scopes$Scope.enter(Scopes.scala:124)
at scala.tools.nsc.transform.SpecializeTypes$$anonfun$specializeClass$1$$anonfun$apply$21.apply(SpecializeTypes.scala:797)
at scala.tools.nsc.transform.SpecializeTypes$$anonfun$specializeClass$1$$anonfun$apply$21.apply(SpecializeTypes.scala:797)
at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
at scala.reflect.internal.SymbolTable.exitingPhase(SymbolTable.scala:256)
at scala.tools.nsc.transform.SpecializeTypes.specializeClass(SpecializeTypes.scala:787)
at scala.tools.nsc.transform.SpecializeTypes.transformInfo(SpecializeTypes.scala:1182)
at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:38)
at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1573)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1493)
at scala.reflect.internal.Trees$TreeSymSubstituter.transform(Trees.scala:1591)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1355)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1318)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1366)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.reflect.internal.Trees$TreeSymSubstituter.transform(Trees.scala:1614)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1355)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1318)
at scala.reflect.internal.Trees$$anonfun$itransform$2.apply(Trees.scala:1363)
at scala.reflect.internal.Trees$$anonfun$itransform$2.apply(Trees.scala:1361)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1360)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.reflect.internal.Trees$TreeSymSubstituter.transform(Trees.scala:1611)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1355)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1318)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1404)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.reflect.internal.Trees$TreeSymSubstituter.transform(Trees.scala:1611)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1355)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1318)
at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.reflect.internal.Trees$TreeSymSubstituter.transform(Trees.scala:1611)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1355)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1318)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1366)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.reflect.internal.Trees$TreeSymSubstituter.transform(Trees.scala:1614)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1355)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1318)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.reflect.internal.Trees$TreeSymSubstituter.transform(Trees.scala:1614)
at scala.tools.nsc.transform.SpecializeTypes$ImplementationAdapter.transform(SpecializeTypes.scala:1355)
at scala.reflect.internal.Trees$TreeSymSubstituter.apply(Trees.scala:1616)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.addBody(SpecializeTypes.scala:1805)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformDefDef$1(SpecializeTypes.scala:1636)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1688)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformTemplate$1(SpecializeTypes.scala:1599)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1601)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1366)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformTemplate$1(SpecializeTypes.scala:1599)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1601)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform1$6.apply(SpecializeTypes.scala:1585)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform1$6.apply(SpecializeTypes.scala:1583)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1583)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer$$anonfun$54.apply(SpecializeTypes.scala:1949)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer$$anonfun$54.apply(SpecializeTypes.scala:1949)
at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
at scala.reflect.internal.SymbolTable.exitingPhase(SymbolTable.scala:256)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer.transform(SpecializeTypes.scala:1949)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer.transform(SpecializeTypes.scala:1945)
at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:147)
at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:399)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:97)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:162)
at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:96)
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:139)
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.IncrementalCommon.cycle(IncrementalCommon.scala:31)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:39)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:66)
at sbt.inc.Incremental$.compile(Incremental.scala:38)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:26)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:153)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)
at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:45)
at sbt.Compiler$.apply(Compiler.scala:74)
at sbt.Compiler$.apply(Compiler.scala:65)
at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:789)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:781)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:781)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
@xeno-by Do you agree?
from simulacrum.
Thanks for reporting! I'll take a look tomorrow.
from simulacrum.
What version of Scala and paradise are you using? I'm trying with 2.11.6-SNAPSHOT and 2.1.0-SNAPSHOT (both batch compiler and scaladoc compiler) and everything is fine. It would also very much help if you could put up a reproduction as a github project.
from simulacrum.
Also, please let me know if there's something else macro- or paradise-related that needs my attention. I'd be glad to help.
from simulacrum.
Thanks -- 2.11.5 with paradise 2.0.1. GitHub project incoming. :)
from simulacrum.
See https://github.com/mpilquist/macrodoc -- I just tested with both 2.0.1 and 2.1.0-SNAPSHOT. Problem manifests in both cases but only when the trait is defined in function local scope. Defining the trait as a top level type works fine.
from simulacrum.
I can confirm that I can reproduce the crash. Looking into it.
from simulacrum.
I don't think that macro paradise is at fault:
17:05 ~/Projects/211x/sandbox (2.11.x)$ cat Test.scala
object Test extends App {
locally {
trait Semigroup[@specialized(Int, Long) A] {
def append(x: A, y: A): A
}
}
}
17:05 ~/Projects/211x/sandbox (2.11.x)$ scalac Test.scala
error:
EmptyScope.enter
while compiling: Test.scala
during phase: globalPhase=specialize, enteringPhase=explicitouter
library version: version 2.11.5-20150109-132948-05612399f7
compiler version: version 2.11.5-20150109-132948-05612399f7
reconstructed args:
last tree to typer: type Test
tree position: line 1 of Test.scala
tree tpe: <notype>
symbol: object Test
symbol definition: class Test extends App (a ModuleClassSymbol)
symbol package: <empty>
symbol owners: object Test
call site: trait Semigroup in package <empty>
== Source file context for tree position ==
0 object Test extends App {
1 locally {
2 trait Semigroup[@specialized(Int, Long) A] {
3 def append(x: A, y: A): A
4 }
5 }
6 }
error: scala.reflect.internal.FatalError:
EmptyScope.enter
while compiling: Test.scala
during phase: globalPhase=specialize, enteringPhase=explicitouter
library version: version 2.11.5-20150109-132948-05612399f7
compiler version: version 2.11.5-20150109-132948-05612399f7
reconstructed args:
last tree to typer: type Test
tree position: line 1 of Test.scala
tree tpe: <notype>
symbol: object Test
symbol definition: class Test extends App (a ModuleClassSymbol)
symbol package: <empty>
symbol owners: object Test
call site: trait Semigroup in package <empty>
== Source file context for tree position ==
0 object Test extends App {
1 locally {
2 trait Semigroup[@specialized(Int, Long) A] {
3 def append(x: A, y: A): A
4 }
5 }
6 }
at scala.reflect.internal.Reporting$class.abort(Reporting.scala:59)
at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:16)
at scala.reflect.internal.Scopes$EmptyScope$.enterEntry(Scopes.scala:460)
at scala.reflect.internal.Scopes$Scope.enter(Scopes.scala:124)
at scala.tools.nsc.transform.SpecializeTypes$$anonfun$specializeClass$1$$anonfun$apply$21.apply(SpecializeTypes.scala:797)
at scala.tools.nsc.transform.SpecializeTypes$$anonfun$specializeClass$1$$anonfun$apply$21.apply(SpecializeTypes.scala:797)
at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
at scala.reflect.internal.SymbolTable.exitingPhase(SymbolTable.scala:256)
at scala.tools.nsc.Global.exitingSpecialize(Global.scala:1055)
at scala.tools.nsc.transform.SpecializeTypes$$anonfun$specializeClass$1.apply(SpecializeTypes.scala:797)
at scala.tools.nsc.transform.SpecializeTypes$$anonfun$specializeClass$1.apply(SpecializeTypes.scala:788)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.tools.nsc.transform.SpecializeTypes.specializeClass(SpecializeTypes.scala:787)
at scala.tools.nsc.transform.SpecializeTypes.transformInfo(SpecializeTypes.scala:1182)
at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:38)
at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1573)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1493)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.makeSpecializedMembers(SpecializeTypes.scala:1820)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformTemplate$1(SpecializeTypes.scala:1590)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1601)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1366)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformTemplate$1(SpecializeTypes.scala:1599)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1601)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform1$6.apply(SpecializeTypes.scala:1585)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform1$6.apply(SpecializeTypes.scala:1583)
at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1583)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer$$anonfun$54.apply(SpecializeTypes.scala:1949)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer$$anonfun$54.apply(SpecializeTypes.scala:1949)
at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
at scala.reflect.internal.SymbolTable.exitingPhase(SymbolTable.scala:256)
at scala.tools.nsc.Global.exitingSpecialize(Global.scala:1055)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer.transform(SpecializeTypes.scala:1949)
at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer.transform(SpecializeTypes.scala:1945)
at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:147)
at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:399)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:399)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
at scala.tools.nsc.Driver.doCompile(Driver.scala:32)
at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
at scala.tools.nsc.Driver.process(Driver.scala:51)
at scala.tools.nsc.Driver.main(Driver.scala:64)
at scala.tools.nsc.Main.main(Main.scala)
from simulacrum.
Thanks! It appears that the TypeClassMacro
has a different bug that's also crashing the compiler. It looks like the GitHub project I posted is a red herring based on a scalac bug. I'm guessing the crash below is caused by something wrong in the TypeClassMacro
.
[trace] Stack trace suppressed: run last test:compile for the full output.
[error] (test:compile) java.lang.AssertionError: assertion failed:
[error] module Adapter#28128 with maybeExpandeeCompanionCompleter for Adapter#28128
[error] while compiling: /Users/mpilquist/Development/projects/simulacrum/src/test/scala/simulacrum/foo.scala
[error] during phase: typer
[error] library version: version 2.11.5
[error] compiler version: version 2.11.5
[error] reconstructed args: -language:implicitConversions -language:higherKinds -deprecation -feature -Xfatal-warnings -classpath /Users/mpilquist/Development/projects/simulacrum/target/scala-2.11/test-classes:/Users/mpilquist/Development/projects/simulacrum/target/scala-2.11/classes:/Users/mpilquist/.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-2.2.3.jar:/Users/mpilquist/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.5.jar:/Users/mpilquist/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.2.jar -Xplugin:/Users/mpilquist/.ivy2/cache/org.scalamacros/paradise_2.11.5/jars/paradise_2.11.5-2.0.1.jar -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre/classes:/Users/mpilquist/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.5.jar
[error]
[error] last tree to typer: Ident($anon)
[error] tree position: line 3 of /Users/mpilquist/Development/projects/simulacrum/src/test/scala/simulacrum/foo.scala
[error] tree tpe: simulacrum.Foo.Adapter[A]{}
[error] symbol: final <$anon: simulacrum.Foo.Adapter[A]>
[error] symbol definition: final class $anon extends Foo.Adapter[A] (a ClassSymbol)
[error] symbol package: simulacrum
[error] symbol owners: <$anon: simulacrum.Foo.Adapter[A]> -> method Adapter -> object Foo
[error] call site: method Adapter in object Foo in package simulacrum
[error]
[error] == Source file context for tree position ==
[error]
[error] 0 package simulacrum
[error] 1
[error] 2 @typeclass trait Foo[@specialized(Int, Long) A] {
[error] 3 def foo(x: A, y: A): A
[error] 4 }
at scala.tools.nsc.Global.assert(Global.scala:262)
at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.completeImpl(Namers.scala:323)
at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.completeImpl(Namers.scala:317)
at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1692)
at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.complete(Namers.scala:299)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1483)
at scala.reflect.internal.Symbols$Symbol.tpe_$times(Symbols.scala:1447)
at scala.tools.nsc.typechecker.Typers$Typer.checkNoDoubleDefs$1(Typers.scala:3060)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3138)
at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1903)
at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1790)
at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5287)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5429)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3028)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
at scala.collection.immutable.List.loop$1(List.scala:173)
at scala.collection.immutable.List.mapConserve(List.scala:189)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3132)
at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:4989)
at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5289)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5425)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
from simulacrum.
Looks like a problem in paradise. How do I reproduce it?
from simulacrum.
Running sbt test
on the topic/specialization branch will cause the issue. https://github.com/mpilquist/simulacrum/tree/topic/specialization-crash
from simulacrum.
Minimized & reproduced: scalamacros/paradise#64. While I'm fixing the issue, you could rename implicit def Adapter
to implicit def <anything but Adapter>
, and things will start working.
from simulacrum.
The bug is now fixed and will be shortly released in paradise 2.1.0-SNAPSHOT.
from simulacrum.
Great! Are you releasing a 2.1.0-M4 too? I'm going to release a 0.2.0 of simulacrum right after you release an M4.
from simulacrum.
Yes, I am, just need a bit more time (an hour or two maximum) to tweak my release scripts. I'll ping you once it's done.
from simulacrum.
Released (e.g. see https://oss.sonatype.org/content/repositories/releases/org/scalamacros/paradise_2.11.5/).
from simulacrum.
Related Issues (20)
- is the fully qualified check necessary?
- refactor to compiler plugin HOT 10
- Some generated public members don't have explicit return types
- add a simulacrum.TypeClass marker trait HOT 4
- Deriving instances from implicits? HOT 1
- varargs does not works HOT 2
- publish for Scala 2.13.0-M5? HOT 6
- Compiler error when using type constraint
- Type mismatch when generating instances for `F[G[_]]`
- Type missmatch errors
- @op annotation causing compilation error on 2.13.1
- Linker errors when used with ScalaJS 1.1.1 HOT 1
- Compilation fails when updating from cats 2.2.0 to 2.3.0 HOT 9
- Ops itself should have a proxy type class HOT 1
- covariant functor typeclass ops HOT 1
- Limit visibility of implementation details
- `sbt doc` fails on `@typeclasses` methods with scaladocs HOT 3
- `Ops` method generation curiosities HOT 4
- `@specialized` isn't "forwarded" to ops
- Experiment with scalagen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simulacrum.