Skip to content

Commit 0e591bf

Browse files
committed
restore typeMatch and block string assignment
1 parent f90297b commit 0e591bf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

macros/parserAssignment.pl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,20 @@ sub new {
348348
my $self = shift; $class = ref($self) || $self;
349349
my $f = $self->SUPER::new(@_);
350350
bless $f, $class if $f->type eq 'Assignment';
351+
my $rhs = $f->getTypicalValue($f)->{data}[1];
352+
Value->Error('Assignment of strings is not allowed.') if $rhs && $rhs->type eq 'String';
351353
return $f;
352354
}
353355

356+
sub typeMatch {
357+
my $self = shift; my $other = shift; my $ans = shift;
358+
return 0 unless $self->type eq $other->type;
359+
my $typeMatch = $self->getTypicalValue($self)->{data}[1];
360+
$other = $self->getTypicalValue($other,1)->{data}[1];
361+
return 1 unless defined($other); # can't really tell, so don't report type mismatch
362+
$typeMatch->typeMatch($other,$ans);
363+
}
364+
354365
sub cmp_class {
355366
my $self = shift; my $value;
356367
if ($self->{tree}{rop}{isConstant}) {

0 commit comments

Comments
 (0)