-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Inline and implicit matches #5392
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
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.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Commit Messages
We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).
Please stick to these guidelines for commit messages:
- Separate subject from body with a blank line
- When fixing an issue, start your commit message with
Fix #<ISSUE-NBR>:
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line ("Add" instead of "Added")
- Wrap the body at 80 characters
- Use the body to explain what and why vs. how
adapted from https://chris.beams.io/posts/git-commit
Have an awesome day! ☀️
1e89bcc
to
39f8101
Compare
This PR brings us roughly to feature parity with the previous rewrite method PR, minus the things one can only do when re-type-checking from scratch. I have listed things that still remain to be done as issues #5404 to #5409. Going forward I will only have very limited time working on this. If we want to see this to a conclusion I need substantial help. I feel my time would be best spent helping others getting up to speed on this. |
Count me in :-) |
How should we go about reviewing? I realize it's difficult since it's a lot of code. On the other hand, most of that code is just a re-instantiation of what we already had before, so less urgent to review it again. Commits with mostly new stuff are: 70a5209, 571d1ba, df124be, 6848fac, 58d8e71, 36323a4, 3ef00b9. Maybe just review those? |
39f8101
to
87590b4
Compare
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.
Otherwise LGTM
Introduce trees for inline and implicit matches
Just syntax and parsing, no interpretation yet.
Undoes: - Drop TransparentTyper (reverted from commit f6c440f)
Undoes: - Drop InlineIf and InlineMatch (reverted from commit 8ae9d6a)
- Revert: Drop InlineIf and InlineMatch (reverted from commit 8ae9d6a) - Modify trees to not use a kind field in Match
Unapply methods can have `inline` flags. This enables reduceProjection to see the methods right hand side. On the other hand, since `unapply` methods are not applied hen used in patterns we do not classify them as inline methods. Consequently they cannot contain inline matches or inline ifs.
- perform implicit search in real Typer, not ReTyper - use existing symbols for match bindings - handle anonymous implicit bindings
Some of them taken by reverting again: Remove remaining bits from untyped inliner (reverted from commit 35646ae) # Conflicts: # compiler/src/dotty/tools/dotc/transform/FirstTransform.scala
Calls to primary constructors of NoInits classes are pure if prefix and arguments are pure.
- adapt tests
The `stageIt` switch determines whether specialization should take place during Typer or during Staging. We should compile a test suite with both switch settings and compare - intermediate code after staging - intermesiate code after erasure - bytecode sizes - compile-time and runtime speed That would let us decide which of the two schemes is preferable.
Reclassify previously invalidated typelevel tests - some of them work again - some of them can be turned into neg tests - the rest gets a note why they are invalid
87590b4
to
8393c6c
Compare
This fixes some rebase breakage.
8393c6c
to
330f666
Compare
Bring back inline and implicit matches in a typed setting.
Based on #5383.