-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Undefined +=
in inner quote
#6772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
This might be related to #7110 |
Self contained version: import scala.quoted._
object Macros {
inline def m() : Any = ${ mImpl() }
def mImpl()(using QuoteContext): Expr[Any] =
List(Expr(1), Expr(2), Expr(3)).toExprOfList
def (list: List[Expr[T]]).toExprOfList[T](using Type[T], QuoteContext): Expr[List[T]] = '{
val buff = List.newBuilder[T]
${ Expr.block(list.map(v => '{ buff += $v }), '{ buff.result() }) }
}
} import scala.quoted._
import Macros._
object Test {
def main(args: Array[String]): Unit = {
println(m())
}
} |
The error now is different, it complains phase consistency for |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 29, 2020
Fix scala#6140, fix scala#6772, fix scala#7030, fix scala#7892, fix scala#7997, fix scala#8651 and improve scala#8100.
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 29, 2020
Fix scala#6140, fix scala#6772, fix scala#7030, fix scala#7892, fix scala#7997, fix scala#8651 and improve scala#8100. Differences with previous implementation * Only track and check levels within quotes or splices * Track levels of all symbols not at level 0 * Split level checking into specialized variants for types and terms (healType/healTermType) * Detect inconsistent types rather than try to detect consistent ones * Check/heal term inconsistencies only on leaf nodes (TypeTree, RefTree, Ident, This)
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
May 4, 2020
Fix scala#6140, fix scala#6772, fix scala#7030, fix scala#7892, fix scala#7997, fix scala#8651 and improve scala#8100. Differences with previous implementation * Only track and check levels within quotes or splices * Track levels of all symbols not at level 0 * Split level checking into specialized variants for types and terms (healType/healTermType) * Detect inconsistent types rather than try to detect consistent ones * Check/heal term inconsistencies only on leaf nodes (TypeTree, RefTree, Ident, This)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implementing
scala.quoted.ExprOps.toExprOfList
withfails with
The text was updated successfully, but these errors were encountered: