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

Add implements keyword for Classes #1318

Open
markwpearce opened this issue Oct 7, 2024 · 0 comments
Open

Add implements keyword for Classes #1318

markwpearce opened this issue Oct 7, 2024 · 0 comments
Labels
BrighterScript enhancement New feature or request
Milestone

Comments

@markwpearce
Copy link
Collaborator

  • Add a new keyword implements to explicitly say which interfaces a class conforms too.
  • A class can explicitly implement multiple interfaces
  • If a class uses the implements keyword, then validation is performed on the class to ensure that the set of its public members are compatible with all the interfaces referenced by the keyword.

Example:

interface Flier
    function takeOff(altitude as float) as boolean
end interface

interface Quacker
    sub quack()
end interface


class Duck implements Flier, Quacker    ' validation error - quack() is not included
    function takeOff(altitude as float) as boolean
       return false
   end function
end class
@markwpearce markwpearce added BrighterScript enhancement New feature or request labels Oct 7, 2024
@markwpearce markwpearce added this to the v1.1.0 milestone Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BrighterScript enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant