gypsum icon indicating copy to clipboard operation
gypsum copied to clipboard

In compiler, Type.lub has incomplete support for trait types

Open jayconrod opened this issue 9 years ago • 1 comments

After left and right are rolled up to ClassTypes, Type.lub calls findCommonBaseClass on their classes. This method is only supported on Class (at the moment), but this field is actually ObjectTypeDefn.

findCommonBaseClass should be renamed to findCommonBase, should be moved to ObjectTypeDefn, and should do a better job of finding a base trait or class.

jayconrod avatar Aug 21 '16 13:08 jayconrod

Blocked by #30.

This problem is not well-defined, since two types may have multiple traits in common. When we have union types, Type.lub should just return a union in this case.

jayconrod avatar Dec 30 '16 20:12 jayconrod