Skip to content
  • Kim Nguyễn's avatar
    Implement weak polymorphic variables. These variables are displayed as _weak0 (as in OCaml). · 892ae0d7
    Kim Nguyễn authored
    They cannot be generalized. These are juste variables "waiting to be instantiated".
    When such an instantiation occurs, the typing environment is patched to substitute all occurrences
    of the variables with their instance.
    As with OCaml, one can observe weak polymorphic variables in the toplevel e.g. by creating mutable
    references or performing partial applications of polymorphic functions.
    When compiling a file, an error is raised when toplevel identifiers whose type contains polymorphic variables remain.
    892ae0d7