daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

Bug in generation of error message for ambiguous types after if-statement #762

Open pdamme opened 5 months ago

pdamme commented 5 months ago

The following DaphneDSL script is invalid, since we cannot change the type of a variable in control flow statements *()**:

a = 1;
b = 1;

if(as.scalar(rand(1, 1, 0.0, 1.0, 1, 12345)) < 0.5)
    a = 2;
else
    b = 2.2; # changes the type of b

print(a);
print(b);

We expect an error message like:

... type of variable `b` after if-statement is ambiguous, could be either si64 (then-branch) or f64 (else-branch)

But instead we get:

... no symbol found for the given value

*()** We intend to support changing the value type (but not the data type), but so far, that is not supported.