You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it's a weird situation that _ has special semantics in pattern matching, bind(), and now even diagnostics mode for locals (#8147), but that you can still use them as if they were regular vars. The common convention for this is already that they're "ignored", so actually using a _ var would be considered bad style anyway. If an error is introduced, _ can be properly documented as a laguage feature for locals.
I know that at least Flambe uses _ as an identifer, but that's only on field level I think? So shouldn't be impacted by this.
@terurou Thanks, I had forgotten about that issue actually. So yeah, if the compiler was a bit stricter here, it could definitely help avoid some confusion.
I'm proposing that the following code should throw "ignored variables cannot be used" errors.
I think it's a weird situation that
_
has special semantics in pattern matching,bind()
, and now even diagnostics mode for locals (#8147), but that you can still use them as if they were regular vars. The common convention for this is already that they're "ignored", so actually using a_
var would be considered bad style anyway. If an error is introduced,_
can be properly documented as a laguage feature for locals.I know that at least Flambe uses
_
as an identifer, but that's only on field level I think? So shouldn't be impacted by this.This might also allow to revisit #4381.
The text was updated successfully, but these errors were encountered: