Fix NPE in task macro accessing q"{...}".symbol.pos

We shouldn't assume that the qualifier of a `Select` is a
`SymTree`; it may be a `Block`. One place that happens
is after the transformation of named/defaults applications.
That causes the reported `NullPointerException'.

In any case, using `qual.symbol.pos` sense here; it yields the
position of the defintions *referred to* by `qual`, not the
position of `qual` itself.

Both problems are easily fixed: use `qual.pos` instead.

Fixes #1107
This commit is contained in:
Jason Zaugg 2014-02-07 18:05:00 +01:00
parent c398b1bf64
commit f66830eed9
1 changed files with 1 additions and 1 deletions

View File

@ -167,7 +167,7 @@ object Instance
def addType(tpe: Type, qual: Tree, selection: Tree): Tree =
{
qual.foreach(checkQual)
val vd = util.freshValDef(tpe, qual.symbol.pos, functionSym)
val vd = util.freshValDef(tpe, qual.pos, functionSym)
inputs ::= new Input(tpe, qual, vd)
util.refVal(selection, vd)
}