Skip to content

Commit

Permalink
Treat the expression as resolved if the primary_type is nil, as in `r…
Browse files Browse the repository at this point in the history
…eturn`. mirah#157
  • Loading branch information
abscondment committed Dec 14, 2011
1 parent 1a5c40e commit 2fddffe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mirah/ast/flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def infer(typer, expression)
if types.any? {|t| t.nil?}
typer.defer(self)
else
if !expression || clause_types.all?{ |t| primary_type.compatible? t}
if !expression || primary_type.nil? || clause_types.all?{ |t| primary_type.compatible? t}
resolved!
types.each do |type|
@inferred_type ||= type unless type.unreachable?
Expand Down

0 comments on commit 2fddffe

Please sign in to comment.