UCSD-PL / refscript

Refinement Types for Scripting Languages
BSD 3-Clause "New" or "Revised" License
65 stars 3 forks source link

Enumerations #57

Closed panagosg7 closed 10 years ago

panagosg7 commented 10 years ago

Addessing #55

For an enumeration

enum E { ADD, SUB, MUL, DIV } 

E has type enum E, E.ADD has type { number | v = 0} etc.

Also, E[0] resolves to a string type: { string | v = "ADD"}

Added some fixes in unification / subtyping:

ranjitjhala commented 10 years ago

Awesome, thanks!