Skip to content
Snippets Groups Projects
Commit 1708d239 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Implement generics for functions and ADTs

- Calling functions are now typed, FunctionInvokation takes a
  TypedFunDef which is basically a FunDef with type parameters' values.
  Instantiation of types within the signature/body is done on demand
  through this wrapper class.

- Operations on ADTs are now taking a *ClassType instead of *ClassDef.
  Similarly, Case/AbstractClassType takes values for type parameters.

- Introduces a GenericValue tree for models targeting abstract types.
  e.g. foo[T](a: T, b: T) { a == b } ensuring (_) will find a model with
  { a -> T#1, b -> T#2 }

- Only "simple" hierarchies allowed with type parameters. All members of
  the hierarchy must define the same number of type parameters and
  correctly pass them to parent classes.

- Type parameters are invariant.
parent 8c91bcc4
No related branches found
No related tags found
No related merge requests found
Showing
with 1040 additions and 597 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment