Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbovel
Copy link
Member

@mbovel mbovel commented Oct 23, 2024

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).

@mbovel mbovel force-pushed the mb/restrict-type-annotations branch from 009c2a4 to a1d0910 Compare October 23, 2024 18:35
@mbovel mbovel changed the title Experiment: restrict allowed trees in type annotations Experiment: restrict allowed trees in annotations Oct 24, 2024
@mbovel mbovel force-pushed the mb/restrict-type-annotations branch 3 times, most recently from f2779a0 to 5455c5d Compare November 5, 2024 22:08
@mbovel

This comment was marked as outdated.

@mbovel
Copy link
Member Author

mbovel commented Nov 6, 2024

val value: Expr[Int] = '{ 42 }
'{ new Quoted[T @Annot($value)] }

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?

@mbovel mbovel force-pushed the mb/restrict-type-annotations branch from 5455c5d to 2cc6ea4 Compare November 6, 2024 13:58
@mbovel

This comment was marked as resolved.

@mbovel mbovel force-pushed the mb/restrict-type-annotations branch from 2cc6ea4 to d9ba132 Compare November 13, 2024 16:02
@mbovel mbovel force-pushed the mb/restrict-type-annotations branch 4 times, most recently from 3a897c7 to dd3b668 Compare November 23, 2024 19:24
@mbovel mbovel force-pushed the mb/restrict-type-annotations branch from 84d83e3 to de0e3e7 Compare January 13, 2025 13:28
@mbovel mbovel force-pushed the mb/restrict-type-annotations branch from de0e3e7 to 408638c Compare January 16, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant