Open jdunkerley opened 2 days ago
This is the same syntactic pitfall as here: #9944 We could improve this by emitting a warning when an expression with no side effects is evaluated without being used. That might be a tall order for the backend to implement in general, but this is not the first time a bug has been reported due to this pitfall--to catch this specific case, we could have a warning if an operator-section occurs in statement context. This would be a syntax warning, so the parser would be the place to implement it.
results in [1,2,3,4]
however
results in [1, 4]