Skip to content

Commit

Permalink
surface (internal): Fix tree owner in surfaceDefs ValDef (#3474)
Browse files Browse the repository at this point in the history
Fixes issue investigated as scala/scala3#20072

Unfortunately there are still other issues preventing compiling with
`-Xcheck-macros`
(https://stackoverflow.com/questions/78193025/how-to-extract-type-parameter-from-typelambda-correctly),
but this fix is an important step in that direction.
  • Loading branch information
OndrejSpanel authored Apr 6, 2024
1 parent 4725c92 commit f095806
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ private[surface] class CompileTimeSurfaceFactory[Q <: Quotes](using quotes: Q):
seenMethodParent.clear()

val surfaceDefs: List[ValDef] = surfaceToVar.toSeq.map { case (tpe, sym) =>
ValDef(sym, Some(surfaceOf(tpe, useVarRef = false).asTerm))
ValDef(sym, Some(surfaceOf(tpe, useVarRef = false).asTerm.changeOwner(sym)))
}.toList

/**
Expand Down

0 comments on commit f095806

Please sign in to comment.