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

Typechecking extractors is not idempotent #5465

Closed
scabug opened this issue Feb 14, 2012 · 5 comments
Closed

Typechecking extractors is not idempotent #5465

scabug opened this issue Feb 14, 2012 · 5 comments
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Feb 14, 2012

Pattern matching that involves extractors cannot be typechecked twice. The first typecheck distorts its structure, introducing UnApply node that wraps a synthetic SELECTOR_DUMMY ident that doesn't have a definition. If one performs resetAllAttrs, the resulting tree can no longer be typechecked.

@scabug
Copy link
Author

scabug commented Feb 14, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5465?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.0
Blocks #5464

@scabug
Copy link
Author

scabug commented Dec 6, 2012

@xeno-by said:
See tests introduced in scala/scala@5028181

@scabug
Copy link
Author

scabug commented Apr 2, 2013

@retronym said:
Here's a potential solution: undo the wrapping Unapply(Apply(Select(qual, <unapply selector>), args)) in ResetAttrs.

https://github.com/retronym/scala/tree/ticket/5465

It solves Eugene Y.'s reported problem with extractors in macros, but does not yet fix run/idempotency-extractors.scala (with the toolbox compiler).

@SethTisue
Copy link
Member

consolidating under #5464

@SethTisue
Copy link
Member

#8825 was in this space and was fixed by scala/scala#6356

#12577 is also in this space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants