jonnyboyC / kos-language-server

A language server for the Kerboscript (kOS) a language for Kerbal Space Program
MIT License
27 stars 6 forks source link

[BUG] Generic type subclassing #64

Closed jonnyboyC closed 5 years ago

jonnyboyC commented 5 years ago

Describe the bug Currently the servers type checking handles generics as follows.

  1. create hierarchy of generic classes
  2. create concrete type of generic
  3. subclass are update to point to new concrete version up to the root structure type

This leads to the issue of userListType not being a subclass of listType even though userListType is simply a concrete implementation of the later. Currently this is a problem for checking indexers. If all lists are simply considered userListTypes we can correctly identify that the return type should be a structure but lost the more specific type information embedded.