Open mvdan opened 4 days ago
Slightly simplified:
a?: #A
a: #A & {}
#A: {
A: [string]: 1 | #a
#a: 2 | {v: 1}
}
This does not panic, but results in a counter issue, which may help understanding the problem:
a?: #A
a: #A & {}
#A: {
b: 1 | a
a: 2 | {v: 1}
}
Update: The optional field and conjunction in the above example are necessary to disable the deduping, causing #A
to be unified with itself. So a reducer that gets more to the meat of the problem is:
{v: 1} | (2 | 3)
{v: 1} | (2 | 3)
So it happens when a disjunction with nested disjunctions gets unified with itself. One of the disjuncts needs to have a field.
Narrowing it down further: the field needs to be defined in the first disjunction, the nested disjunction needs to be defined in the second:
{v: 1} | 2
(4|5) | 3
On 12ac20b36f4de3c638cb2f2ae372df62adcfdbe2: