-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add isExpr
, asExpr
, asExprOf
, asTerm
, asTypeTree
and asQuotedType
#9497
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
Add isExpr
, asExpr
, asExprOf
, asTerm
, asTypeTree
and asQuotedType
#9497
Conversation
These replace the methods `seal`, `sealOpt` and `unseal` with equivalent method with more intuitive names. Insead of `sealOpt` we provide a more flexible `isExpr`. All these methods are defined directly on `Tree` insead of `Term` to avoid the need to perform type test to a `Term` first.
dae7622
to
2722c3d
Compare
isExpr
, asExpr
, asExprOf
and asTerm
isExpr
, asExpr
, asExprOf
, asTerm
, asTypeTree
and asQuotedType
The names That said, I'm open to changes, the only worry is about compatibility -- it seems the change is pervasive and will break most macros written for Dotty. |
The old version will still be supported for some time with a deprecation warning |
The names The |
I can confirm that, as a very new newcomer, this makes more sense. In fact, I hadn't even figured out what |
e2e76e9
to
0f05f66
Compare
Replaced with #9514. Will do this in smaller parts |
These replace the
Expr
methodsseal
,sealOpt
andunseal
with equivalent methods with more intuitive names.Instead of
sealOpt
we provide a more flexibleisExpr
. All these methods are defined directly onTree
instead of
Term
to avoid the need to perform type test to aTerm
first.We similarly replace
quoted.Type.seal
withasTypeTree
andreflect.Type.seal
withasQuotedType
.Note: #8940 would remove the
asTerm
andasTypeTree
as there we haveExpr[T] <:< Term
and something similar forType
, but the others would still be relevant.