-
Notifications
You must be signed in to change notification settings - Fork 1.1k
De-anonymize patvar in given pattern #23121
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
base: main
Are you sure you want to change the base?
Conversation
def4dd7
to
4d0f402
Compare
The analysis relies on ignoring derived names and also correlating pattern vars by position. The existing artifact received a "fresh" name and a zero-extent synthetic position. |
The gods would often appear in disguise -- probably one may say more precisely that they were present but did not appear -- and in fact, the Easter story tells us that they didn't recognize Jesus, though maybe that was because they were not expecting him. Did you know that the incognito gods dwell on Mount Anonympus? In English, the given name is a Vorname, Taufname, which, one discovers as a parent, is also invented. |
4d0f402
to
1df2c1d
Compare
1df2c1d
to
c9a9dbc
Compare
I would like to settle on conventions for "refining" patterns. I changed names in the match:
where Previously, This is the other example, where it used to say
I should certainly not introduce the alias bind. |
Fixes #23119
A given pattern in a for comprehension results in a fresh val in the body of the mapping function, but is not correlated with patvars.
This commit gives the given its usual given name (in
makeIdPat
) so that the unused check can check it.A subsequent pattern var is named when typechecked, which resulted in the warning.
The fix adds thePatternVar
attachment inmakeIdPat
and also fixes the tree pos, so that it corresponds to the position of the pat var in the elaboration of the for (that is, the position of thegiven T
tree).The unused check can now detect the patvar using the attachment and use the tree pos (instead of the bind name pos).Adds some mild refactoring to name subexpressions and reduce line lengths.