rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Type.rsc is out of sync with actual implementation of Rascal's type system

Open PaulKlint opened this issue 1 year ago • 1 comments

Describe the bug

Type.rsc is out of sync with the actual implementation of Rascal's type system

Expected behavior Type.rsc defines functions like subtype, lub and glb on Rascal types. These definitions should be fully compatible with the actual implementation in the interpreter. There are subtle differences in the handling of function types.

Desktop (please complete the following information):

  • Context: Eclipse plugin
  • Rascal Version 0.28.1

PaulKlint avatar Oct 04 '23 13:10 PaulKlint

Ok let's fix this and let's introduce a compatibility test using the type reifier. We can see if:

t1.JavaIsSubtypeOf(t2) <==> RascalIsSubtypeOf(reify(t1), reify(t2))

and similar equivalences, preferably using the random type generator as well, next to some typical regression cases.

jurgenvinju avatar Oct 04 '23 13:10 jurgenvinju