File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ function getfield_elim_pass!(ir::IRCode)
571
571
elseif is_known_call (stmt, isa, compact)
572
572
# TODO
573
573
continue
574
- elseif is_known_call (stmt, typeassert, compact)
574
+ elseif is_known_call (stmt, typeassert, compact) && length (stmt . args) == 3
575
575
# Canonicalize
576
576
# X = typeassert(Y, T)::S
577
577
# into
@@ -592,7 +592,7 @@ function getfield_elim_pass!(ir::IRCode)
592
592
compact. result[idx][:line ]), true )
593
593
compact. ssa_rename[compact. idx- 1 ] = pi
594
594
continue
595
- elseif is_known_call (stmt, (=== ), compact)
595
+ elseif is_known_call (stmt, (=== ), compact) && length (stmt . args) == 3
596
596
c1 = compact_exprtype (compact, stmt. args[2 ])
597
597
c2 = compact_exprtype (compact, stmt. args[3 ])
598
598
if ! (isa (c1, Const) || isa (c2, Const))
Original file line number Diff line number Diff line change @@ -3313,3 +3313,7 @@ end |> first === Tuple{Int, String}
3313
3313
3314
3314
# issue #40742
3315
3315
@test Base. return_types (string, (Vector{Tuple{:x }},)) == Any[String]
3316
+
3317
+ # issue #40804
3318
+ @test Base. return_types (()) do ; === (); end == Any[Union{}]
3319
+ @test Base. return_types (()) do ; typeassert (); end == Any[Union{}]
You can’t perform that action at this time.
0 commit comments