lib/activefacts/cql/compiler/query.rb in activefacts-cql-1.9.3 vs lib/activefacts/cql/compiler/query.rb in activefacts-cql-1.9.4

- old
+ new

@@ -37,16 +37,19 @@ end def build_step query, clause, roles_by_binding = {}, parent_variable = nil return unless clause.refs.size > 0 # Empty clause... really? - step = @constellation.Step( - query, query.all_step.size, - :fact_type => clause.fact_type, - :alternative_set => nil, - :is_disallowed => clause.certainty == false, - :is_optional => clause.certainty == nil - ) + # A bare object type is a valid clause, but it contains no fact type hence no step + if clause.fact_type + step = @constellation.Step( + query, query.all_step.size, + :fact_type => clause.fact_type, + :alternative_set => nil, + :is_disallowed => clause.certainty == false, + :is_optional => clause.certainty == nil + ) + end trace :query, "Creating Plays for #{clause.inspect} with #{clause.refs.size} refs" do is_input = true clause.refs.each do |ref| # These refs are the Compiler::References, which have associated Metamodel::RoleRefs,