mirror of https://github.com/sbt/sbt.git
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:
parent
c398b1bf64
commit
f66830eed9
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue