-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:inlinearea:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bugstat:needs minimizationNeeds a self contained minimizationNeeds a self contained minimization
Milestone
Description
Compiler version
If you're not sure what version you're using, run print scalaVersion from sbt
(if you're running scalac manually, use scalac -version instead).
Minimized code
I don't have minimized repro yet. In sbt .value method for a setting is implemented as follows:
extension [A1](in: Initialize[A1])
inline def value: A1 = InputWrapper.wrapInit[A1](in)For example,
name := "abc" + version.valuefirst becomes
name := "abc" + InputWrapper.wrapInput(version)Later on :=(...) macro expands the above to
name.set(version.mapN { p0 => "abc" + p0 })Output
While expanding a macro, a reference to value in$proxy1 was used outside the scope where it was defined
This happens I think because .value expands to
name := "abc" + {
val in$proxy1 = version
InputWrapper.wrapInput(in$proxy1)
}Expectation
Inline extension method is inlined.
As a workaround, I've started inlining these myself - https://gist.github.com/eed3si9n/6fc1e89f9a730f0e827327af0c268cb1
Metadata
Metadata
Assignees
Labels
area:inlinearea:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bugstat:needs minimizationNeeds a self contained minimizationNeeds a self contained minimization