Disallow (->) as a data constructor name (#16999)
The code was misusing isLexCon, which was never meant for validation. In fact, its documentation states the following: Use these functions to figure what kind of name a 'FastString' represents; these functions do /not/ check that the identifier is valid. Ha! This sign can't stop me because I can't read. The fix is to use okConOcc instead. The other checks (isTcOcc or isDataOcc) seem superfluous, so I also removed those.
Showing
- compiler/GHC/Parser/PostProcess.hs 2 additions, 3 deletionscompiler/GHC/Parser/PostProcess.hs
- testsuite/tests/parser/should_fail/T16999.hs 6 additions, 0 deletionstestsuite/tests/parser/should_fail/T16999.hs
- testsuite/tests/parser/should_fail/T16999.stderr 2 additions, 0 deletionstestsuite/tests/parser/should_fail/T16999.stderr
- testsuite/tests/parser/should_fail/all.T 1 addition, 0 deletionstestsuite/tests/parser/should_fail/all.T
Loading
Please register or sign in to comment