dimitriv / Ziria

A domain-specific-language and compiler for low-level bitstream processing.
92 stars 18 forks source link

Automatically cast types where there is no loss in precision #10

Open bradunov opened 10 years ago

bradunov commented 10 years ago

var a:int32; var b:int16;

a := a+b;

Currently, this fails because the types of a and b don't match. But we can safely automatically cast b into int32 and compile the code. Add automatic casting wherever it makes sense.