-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3050: Avoid retyping synthesised code #3065
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 ("Added" instead of "Add")
- 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! ☀️
The stackoverflow is spurious and unrelated to this PR, it's the same issue as #2924 |
test performance please |
performance test scheduled: 1 jobs in total. |
@nicolasstucki Can we open a separate PR with the last commit if it fixes #2924? I am eager to get this in as it would solve many CI failures. |
def foldRightBN[U](z: => U)(op: (T, => U) => U): U = xs match { | ||
def foldRightBN[U](z: => U)(op: (T, => U) => U): U = xs.reverse.foldLeftBN(z)(op) | ||
|
||
@tailrec final def foldLeftBN[U](z: => U)(op: (T, => U) => U): U = xs match { |
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.
foldLeft
in the standard library has the accumulator as the first arg of the closure:
def foldLeft[U](z: U)(op: (U, T) => U): U
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.
Oh yes, z
is supposed to be called acc
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.
I will create a separate PR with this.
You will need to remove commit 00cf7f6 and rebase. |
Maybe no need of rebase |
// resolved it (via the web interface 👍 )
|
It is not exactly the same code |
Your stack is 1/4 smaller, but it was not enough. You will need the fix in #3080. |
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.
👍
untpd.Apply( | ||
untpd.Select(untpd.TypedSplice(tree), nme.EQ), | ||
untpd.TypedSplice(dummyTreeOfType(pt))) | ||
typedExpr(cmp, defn.BooleanType)(ctx.retractMode(Mode.Pattern)) |
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.
retractMode(Pattern)
is redundant (it's removed by typedExpr
)
@@ -2277,4 +2269,18 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit | |||
} | |||
} | |||
} | |||
|
|||
protected def checkEqualityEvidence(tree: tpd.Tree, pt: Type)(implicit ctx: Context) : Unit = { |
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.
/** Check that `tree == x: pt` is typeable. Used when checking a pattern
* againts a selector of type `pt`. This implementation accounts for
* user-defined definitions of `==`.
* Overwritten to no-op in ReTyper.
*/
@OlivierBlanvillain can you give me pointers to debug this stackoverflow with the optimised bootstrapped compiler version? |
Have you tried with the fix in #3080? |
@allanrenucci let's see (although I feel that it is a different error) |
Tada! thanks @allanrenucci! |
This is a crude way to fix #3050's bugs with retyping inlined code involving pattern matching.
WDYT?