Skip to content
Snippets Groups Projects
Commit f97a7aac authored by Sebastian Graf's avatar Sebastian Graf Committed by Marge Bot
Browse files

Fix some duplication in the parser

D3673 experienced reduce/reduce conflicts when trying to use
opt_instance for associated data families.

That was probably because the author tried to use it for
Haskell98-syntax without also applying it to GADT-syntax, which actually
leads to a reduce/reduce conflict. Consider the following state:

```
data . T = T
data . T where T :: T
```

The parser must decide at this point whether or not to reduce an empty
`opt_instance`. But doing so would also commit to either
Haskell98 or GADT syntax! Good thing we also accept an optional
"instance" for GADT syntax, so the `opt_instance` is there in both
productions and there's no reduce/reduce conflict anymore.

Also no need to inline `opt_instance`, how it used to be.
parent b5f24fb4
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment