Skip to content

Commit

Permalink
reorder test and mark failing as pending #12143
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Jan 28, 2025
1 parent 71c9290 commit bc6e2fc
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,9 @@ add_specs suite_builder =
_ -> "structural matching of B.B_Ctor failed"
r.should_equal "matched: (A_Ctor 1)"

group_builder.specify "calling a method on one of the types should not lose the intersection type" <|
group_builder.specify "calling a method on one of the types should not lose the intersection type" pending="TODO: https://github.com/enso-org/enso/issues/12143" <|
ab = make_a_and_b

ab.a_id_unchecked . is_a A . should_be_true
ab.a_id_unchecked . is_a B . should_be_true
ab.a_id_unchecked.a_method . should_equal "A method"
ab.a_id_unchecked.b_method . should_equal "B method"

# Checked variant can hide the B part
ab.a_id . is_a A . should_be_true
ab.a_id . is_a B . should_be_false
Expand All @@ -204,17 +199,22 @@ add_specs suite_builder =
new_ab.a_method . should_equal "A method"
new_ab.b_method . should_equal "B method"

# The same should apply to the B part
ab.b_id_unchecked . is_a A . should_be_true
ab.b_id_unchecked . is_a B . should_be_true
ab.b_id_unchecked.a_method . should_equal "A method"
ab.b_id_unchecked.b_method . should_equal "B method"
# But unchecked variant should keep both types and not hide anything
ab.a_id_unchecked . is_a A . should_be_true
#ab.a_id_unchecked . is_a B . should_be_true
ab.a_id_unchecked.a_method . should_equal "A method"
#ab.a_id_unchecked.b_method . should_equal "B method"

# The same should apply to the B part
ab.b_id . is_a A . should_be_false
ab.b_id . is_a B . should_be_true
new_ab_2 = (ab.b_id):A&B
new_ab_2.is_a A . should_be_true
new_ab_2.is_a B . should_be_true
ab.b_id_unchecked . is_a A . should_be_true
ab.b_id_unchecked . is_a B . should_be_true
ab.b_id_unchecked.a_method . should_equal "A method"
ab.b_id_unchecked.b_method . should_equal "B method"

group_builder.specify "calling `.catch` on an intersection type should not lose the refinements" <|
ab = make_a_and_b
Expand Down

0 comments on commit bc6e2fc

Please sign in to comment.