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
#10527 made Union(T, U) and Union(U, T) equivalent only if neither T nor U is itself an (irreducible) union type, as the outer type merge algorithm (Crystal::Program#type_combine) was untouched. Certain union operations still fail to be commutative and associative if unions and modules are involved:
moduleA; endclassB; includeA; endclassC; includeA; end
(A|B) |C# => A
(A|C) |B# => A
(B|A) |C# => A
(B|C) |A# => (A | C)
(C|A) |B# => A
(C|B) |A# => (A | C)A| (B|C) # => AA| (C|B) # => AB| (A|C) # => AB| (C|A) # => AC| (A|B) # => AC| (B|A) # => AUnion(A, B, C) # => AUnion(A, C, B) # => AUnion(B, A, C) # => AUnion(B, C, A) # => (A | C)Union(C, A, B) # => AUnion(C, B, A) # => (A | B)
All of the above unions should produce A.
The text was updated successfully, but these errors were encountered:
#10527 made
Union(T, U)
andUnion(U, T)
equivalent only if neitherT
norU
is itself an (irreducible) union type, as the outer type merge algorithm (Crystal::Program#type_combine
) was untouched. Certain union operations still fail to be commutative and associative if unions and modules are involved:All of the above unions should produce
A
.The text was updated successfully, but these errors were encountered: