Skip to content

Commit

Permalink
Improve error output when we have a junction of types.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jul 31, 2009
1 parent a53a1cd commit e02bc06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/builtins/guts.pir
Expand Up @@ -1438,7 +1438,20 @@ over the rest of the code base.
output = concat what_failed, " type check failed; expected "
# Work out what we were looking for and show that.
$I0 = isa wanted_type, 'P6protoobject'
if $I0 goto simple_type
$I0 = isa wanted_type, 'Junction'
if $I0 goto junc_wanted
simple_type:
$P0 = wanted_type.'WHAT'()
goto wanted_type_done
junc_wanted:
$P0 = wanted_type
$P1 = $P0.'eigenstates'()
$I0 = elements $P1
if $I0 > 1 goto wanted_type_done
$P0 = $P1[0]
wanted_type_done:
$S0 = $P0.'perl'()
output = concat $S0
Expand Down

0 comments on commit e02bc06

Please sign in to comment.