dimitriv / Ziria

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

Type checker accepts more operations on complex numbers than supported #89

Open edsko opened 9 years ago

edsko commented 9 years ago

For example,

-- Testing complex numbers

fun comp test16() {
  a <- take;
  emit a;

  let x = complex16 { re = 2; im = 3 };
  let y = complex16 { re = 3; im = 4 };

  emit (if x == x then 1 else 0);
  emit (if x == y then 1 else 0);

  emit a;
}

let comp main = read[int] >>> test16() >>> write[int]

is accepted by the type checker, but we don't in fact support comparing complex numbers for equality in the code generator.