rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
152 stars 47 forks source link

require override keyword for overriding class methods #21

Closed georgejecook closed 4 years ago

georgejecook commented 4 years ago

I'm already starting to need this issue in my bs code.. would be lovely if, given a class

class BaseClass

public function load()

that the extended class

class SpecificThingLoader
public function load()

will throw a compiler error.

The syntax in this case should be

override public function load()

I'm not suggesting we support super classes at this point; though I may in future; but truth be told, I've only ever had to swizzle an aa for a superclass access less than a handful of times.

TwitchBronBron commented 4 years ago

This has been implemented in this commit: https://github.com/rokucommunity/brighterscript/commit/7bf33efe98e71ba859935a7781447164e44f4749#diff-39827f4e358f229664ca4c4ca8c92162R75-R82