com-lihaoyi/sourcecode

Compilation failure

stanch opened this issue · 2 comments

@ plot(Zipper(descendancy(2).sample.get))
Main.scala:144: exception during macro expansion: 
java.lang.UnsupportedOperationException: Position.point on NoPosition
    at scala.reflect.internal.util.Position.fail(Position.scala:17)
    at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:95)
    at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:90)
    at scala.reflect.internal.util.DeprecatedPosition$class.startOrPoint(Position.scala:247)
    at scala.reflect.internal.util.Position.startOrPoint(Position.scala:12)
    at sourcecode.Impls$$anonfun$1.applyOrElse(SourceContext.scala:118)
    at sourcecode.Impls$$anonfun$1.applyOrElse(SourceContext.scala:118)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1657)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1654)
    at scala.reflect.internal.Trees$$anonfun$traverseMemberDef$1$1.apply$mcV$sp(Trees.scala:1209)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.internal.Trees$class.traverseMemberDef$1(Trees.scala:1203)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1328)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1658)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1654)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at scala.reflect.api.Trees$Traverser.traverseParams(Trees.scala:2492)
    at scala.reflect.api.Trees$Traverser.traverseParamss(Trees.scala:2493)
    at scala.reflect.internal.Trees$$anonfun$traverseMemberDef$1$1.apply$mcV$sp(Trees.scala:1213)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.internal.Trees$class.traverseMemberDef$1(Trees.scala:1203)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1328)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1658)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1654)
    at scala.reflect.api.Trees$Traverser$$anonfun$traverseStats$1$$anonfun$apply$1.apply$mcV$sp(Trees.scala:2498)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.api.Trees$Traverser.traverseStats(Trees.scala:2497)
    at scala.reflect.internal.Trees$class.traverseComponents$1(Trees.scala:1232)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1330)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1658)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1654)
    at scala.reflect.internal.Trees$$anonfun$traverseMemberDef$1$1.apply$mcV$sp(Trees.scala:1207)
    at scala.reflect.api.Trees$Traverser.atOwner(Trees.scala:2507)
    at scala.reflect.internal.Trees$class.traverseMemberDef$1(Trees.scala:1203)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1328)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1658)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1654)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at scala.reflect.internal.Trees$class.traverseComponents$1(Trees.scala:1234)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1330)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1658)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1654)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at scala.reflect.internal.Trees$class.traverseComponents$1(Trees.scala:1284)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1330)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1658)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1654)
    at scala.reflect.api.Trees$Traverser.traverseTrees(Trees.scala:2484)
    at scala.reflect.internal.Trees$class.traverseComponents$1(Trees.scala:1284)
    at scala.reflect.internal.Trees$class.itraverse(Trees.scala:1330)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itraverse(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Traverser.traverse(Trees.scala:2475)
    at scala.reflect.internal.Trees$CollectTreeTraverser.traverse(Trees.scala:1658)
    at scala.reflect.internal.Trees$TreeContextApiImpl.collect(Trees.scala:118)
    at sourcecode.Impls$.text(SourceContext.scala:118)

plot(Zipper(descendancy(2).sample.get))
           ^
Compilation Failed

I will publish that code soon, so it will be possible to try it.

This is the best reproducer I have so far:

git clone https://github.com/stanch/unzimm
cd unzimm
sbt amm
@ def f(a: sourcecode.Text[Zipper[Tree]]) = a.source
defined function f
@ f(Zipper(simpleTree))
Main.scala:330: exception during macro expansion: 
java.lang.UnsupportedOperationException: Position.point on NoPosition
<BAM>

Seems to be fixed by ef7642f