-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Experiment: restrict allowed trees in annotations #21840
base: main
Are you sure you want to change the base?
Conversation
009c2a4
to
a1d0910
Compare
f2779a0
to
5455c5d
Compare
scala3/tests/neg-custom-args/captures/reaches2.scala Lines 4 to 5 in 5455c5d
In this test,
|
scala3/tests/pos-macros/i7519b.scala Lines 11 to 12 in 5455c5d
Another question is what to do with splices, such as in the example above. Type splices are not valid anyway, so it might be okay to also refuse splices in type annotations? |
5455c5d
to
2cc6ea4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Throw away erroneous trees to avoid unpickling issues in best-effort mode. Co-Authored-By: Kacper Korban <kacper.f.korban@gmail.com>
2cc6ea4
to
d9ba132
Compare
And use a TreeMap for the annotation check
a7bd23b
to
6cc02f0
Compare
6cc02f0
to
040ec39
Compare
3a897c7
to
dd3b668
Compare
Non-basic trees in type annotations currently cause compiler crashes. This experiment introduces restrictions on the trees allowed in annotations, similar to those in Java (§9.7. Annotations).