of => $self->coll_var
);
my ($member, $of) = @args{qw(member of)};
- die "member bound" if $member->is_bound;
- my $set = $state->facts->{my $type = $state->resolve_value($of)};
- my $ref_set = DX::RefSet->new(
- target => $type, names => [ $set->key_list ],
+ my $type = $state->resolve_value($of);
+ my $set = ref($type) ? $type : $state->facts->{$type};
+ if ($member->is_bound) {
+ my $test = $state->resolve_value($member);
+ if (grep { $_ eq $test } $set->all) {
+ return $state->then($self->next);
+ }
+ return $state->backtrack;
+ }
+ my $ref_set = (
+ ref($type)
+ ? $set
+ : DX::RefSet->new(
+ target => $type, names => [ $set->key_list ],
+ )
);
return $state->then($self->next)
->add_dependencies($member->id, $of->id)