mirror of https://github.com/sbt/sbt.git
Merge pull request #8106 from eed3si9n/wip/repro-nested-macro2
[2.x] fix: Fix qual lookup
This commit is contained in:
commit
ff7dd1b76d
|
|
@ -266,7 +266,15 @@ trait Cont:
|
|||
(name: String, tpe: Type[x], qual: Term, oldTree: Term) =>
|
||||
given Type[x] = tpe
|
||||
convert[x](name, qual) transform { (replacement: Term) =>
|
||||
val idx = inputs.indexWhere(input => input.qual == qual)
|
||||
val idxEq = inputs.indexWhere(input => input.qual == qual)
|
||||
// use show to compare trees for Def.task comparison
|
||||
val idx =
|
||||
if idxEq < 0 then inputs.indexWhere(input => input.qual.show == qual.show)
|
||||
else idxEq
|
||||
if idx < 0 then
|
||||
sys.error(
|
||||
s"qual (${qual}) not found in ${inputs.map(_.qual)}"
|
||||
)
|
||||
applyTuple(p0, br.inputTupleTypeRepr, idx)
|
||||
}
|
||||
val modifiedBody =
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
lazy val a1 = settingKey[Boolean]("")
|
||||
|
||||
scalaVersion := "3.6.4"
|
||||
a1 := true
|
||||
|
||||
Compile / sourceGenerators += {
|
||||
val _ = a1.value
|
||||
Def.task {
|
||||
Seq.empty[File]
|
||||
}.taskValue
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> compile
|
||||
Loading…
Reference in New Issue