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)
571571 elseif is_known_call (stmt, isa, compact)
572572 # TODO
573573 continue
574- elseif is_known_call (stmt, typeassert, compact)
574+ elseif is_known_call (stmt, typeassert, compact) && length (stmt . args) == 3
575575 # Canonicalize
576576 # X = typeassert(Y, T)::S
577577 # into
@@ -592,7 +592,7 @@ function getfield_elim_pass!(ir::IRCode)
592592 compact. result[idx][:line ]), true )
593593 compact. ssa_rename[compact. idx- 1 ] = pi
594594 continue
595- elseif is_known_call (stmt, (=== ), compact)
595+ elseif is_known_call (stmt, (=== ), compact) && length (stmt . args) == 3
596596 c1 = compact_exprtype (compact, stmt. args[2 ])
597597 c2 = compact_exprtype (compact, stmt. args[3 ])
598598 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}
33133313
33143314# issue #40742
33153315@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