Inline Traits & Specialized Traits#26156
Draft
starswap wants to merge 308 commits into
Draft
Conversation
… where necessary, tidy
…, generate specializations recursively
…s from the parent traits later so they need to live in the children
This reverts commit b1570f5.
d0677c5 to
8855296
Compare
8855296 to
583a583
Compare
78aec78 to
afd9b33
Compare
…t just ordering change)
Opaque types can appear in inline traits. This is not the case for inline methods, so we run into the new case that a LazyBodyAnnotation contains an inline trait. This causes a problem because the LazyBodyAnnotation and the ordinary code both complete the opaque type's LazyRefs which causes us to throw a CyclicReference. It turns out that this CyclicReference throw was originally created for a test case which we no longer reject (typer evolved and we now accept tests/pos/i9052. Therefore we conclude that this CyclicReference is no longer really needed. Removing it allows us to support opaque types in inline traits but it does change the error behaviour of two other tests (modified in this commit). I claim that the resulting errors are acceptable for both of these cases. In particular, the issues they correspond to were both crashes, and we still don't crash without the cyclic reference error. The errors we throw are modified but I think reasonable; feel free to check for yourself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
still DRAFT!! : )
Final year master's project at EPFL. Introduces specialization for Scala 3 as an experimental feature, via:
The latest specification for each of these is included in docs accompanying the PR. To see an demo of the generated code and speed gain offered, try
tools/benchmarks/SpecializedTraitsBenchmark.scalaHow much have you relied on LLM-based tools in this contribution?
Moderately, for debugging.
How was the solution tested?
New automated tests