Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support interfaces having multiple base interfaces #2711

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Mar 10, 2024

  1. Add support for interfaces extending multiple interfaces

    This is a feature in TypeScript, and I didn't see much of a technical
    reason to disallow it. By changing interface extension such that
    implementsTypes and interfacePrototypes are used for base interfaces
    instead of extendsType and basePrototype in InterfacePrototype and
    Interface respectively, and by modifying the parser, existing code
    doesn't seem to break, and multiple base interfaces are possible (if not
    working already).
    
    There was also a small change to the instanceof helper generation, where
    arrays are now used instead of Sets, since I needed to filter for
    interfaces, and Set_values was used on the constructed Set regardless.
    However, the change also modified the order of instanceof checks as seen
    in instanceof.debug.wat. The instanceof.release.wat file underwent more
    drastic changes, but it still appears to work anyway.
    CountBleck committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    f4e24e3 View commit details
    Browse the repository at this point in the history
  2. Add a proper test for multiple interfaces

    Without inspecting the resulting WAT, and instead concluding based on
    the test compiling successfully and executing without any errors,
    everything seems to work properly.
    CountBleck committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    5abcad8 View commit details
    Browse the repository at this point in the history