mirror of https://github.com/sbt/sbt.git
set position on parameter references in task/setting macros
This commit is contained in:
parent
ee5f09d810
commit
9b1cdb7534
|
|
@ -144,11 +144,12 @@ final class ContextUtil[C <: Context](val ctx: C)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Create a Tree that references the `val` represented by `vd`. */
|
/** Create a Tree that references the `val` represented by `vd`. */
|
||||||
def refVal(vd: ValDef): Tree =
|
def refVal(vd: ValDef, pos: Position): Tree =
|
||||||
{
|
{
|
||||||
val t = Ident(vd.name)
|
val t = Ident(vd.name)
|
||||||
assert(vd.tpt.tpe != null, "val type is null: " + vd + ", tpt: " + vd.tpt.tpe)
|
assert(vd.tpt.tpe != null, "val type is null: " + vd + ", tpt: " + vd.tpt.tpe)
|
||||||
t.setType(vd.tpt.tpe)
|
t.setType(vd.tpt.tpe)
|
||||||
|
t.setPos(pos)
|
||||||
t
|
t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ object Instance
|
||||||
qual.foreach(checkQual)
|
qual.foreach(checkQual)
|
||||||
val vd = util.freshValDef(tpe, qual.symbol)
|
val vd = util.freshValDef(tpe, qual.symbol)
|
||||||
inputs ::= new Input(tpe, qual, vd)
|
inputs ::= new Input(tpe, qual, vd)
|
||||||
util.refVal(vd)
|
util.refVal(vd, qual.pos)
|
||||||
}
|
}
|
||||||
def sub(name: String, tpe: Type, qual: Tree): Converted[c.type] =
|
def sub(name: String, tpe: Type, qual: Tree): Converted[c.type] =
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue