-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Handle some explicit paths in quotes #8113
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
Conversation
5415988
to
fc373e5
Compare
@@ -7,7 +7,7 @@ object Unpickler { | |||
|
|||
type PickledQuote = List[String] | |||
type PickledExprArgs = Seq[Seq[Any] => ((QuoteContext ?=> Expr[Any]) | Type[_])] | |||
type PickledTypeArgs = Seq[Seq[Any] => Type[_]] | |||
type PickledTypeArgs = Seq[Seq[Any] => ((QuoteContext ?=> Expr[Any]) | Type[_])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify to only keep PickledArgs
, as PickledExprArgs
and PickledTypeArgs
now have the same definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but there are some bootstrapping constraints.
@@ -179,6 +183,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages( | |||
case tp: TypeRef => | |||
if levelOf(sym).getOrElse(0) < level then tryHeal(sym, tp, pos) | |||
else None | |||
case _: TermRef if ctx.mode.is(Mode.Type) && levelOf(sym).getOrElse(0) >= level => None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be an issue, if it's used in pattern matching, e.g. case _: p.T
? Or, t.asInstanceOf[p.T]
can also be problematic.
@@ -100,7 +104,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages( | |||
case Some(tpRef) => tpRef | |||
case _ => tree | |||
} | |||
case _: TypeTree | _: AppliedTypeTree | _: Apply | _: TypeApply | _: UnApply | Select(_, OuterSelectName(_, _)) => | |||
case _: TypeTree | _: AppliedTypeTree | _: Apply | _: UnApply | Select(_, OuterSelectName(_, _)) => | |||
tree.withType(checkTp(tree.tpe)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ignore TypeApply
?
Replaced with #8796 |
Towards fixing #8100
This is an extension of #7682 that handles path-dependent types used in lower levels.