GaloisInc / saw-script

The SAW scripting language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transitive SAWScript type synonyms don't work

qsctr opened this issue · comments

typedef Foo = Int;
typedef Bar = Foo;
let thing : Bar = 2;

fails with

[08:50:00.917] Loading file "/home/bretton/Documents/github/formal-verso/test.saw"
[08:50:00.918] /home/bretton/Documents/github/formal-verso/test.saw:3:5-3:20: Type Mismatch, expected: Foo but got: Int
 at "thing" (/home/bretton/Documents/github/formal-verso/test.saw:3:5-3:10)
Type mismatch. Expected: Foo but got: Int at "thing" (/home/bretton/Documents/github/formal-verso/test.saw:3:5-3:10)

This problem occurs as long as Bar contains Foo in it (e.g. as part of a larger tuple or record), not just if it is equal to Foo.