-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Under betterFors
don't drop the trailing map
if it would result in a different type (also drop _ => ()
)
#22619
base: main
Are you sure you want to change the base?
Conversation
d6badeb
to
213a3fd
Compare
then gen.expr // avoid a redundant map with identity | ||
else Apply(rhsSelect(gen, mapName), makeLambda(gen, body)) | ||
&& gen.checkMode != GenCheckMode.Filtered // results of withFilter have the wrong type | ||
&& (deepEquals(gen.pat, body) || deepEquals(body, Tuple(Nil))) |
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.
Might factor out the next three lines and use in a method like markTrailingMap(gen, body)
. Then that can be re-used below.
&& deepEquals(gen.pat, body) | ||
then gen.expr // avoid a redundant map with identity | ||
else Apply(rhsSelect(gen, mapName), makeLambda(gen, body)) | ||
&& gen.checkMode != GenCheckMode.Filtered // results of withFilter have the wrong type |
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.
This is non-standard indentation, but I'd tend t leave it in to be able to judge better how it looks.
closes #21804