fredreichbier / ooc-lua

lua binding for ooc
MIT License
8 stars 1 forks source link

Take care of callability of static functions #10

Open fredreichbier opened 10 years ago

fredreichbier commented 10 years ago

by @nddrylliog related to #9:

Note that 'final' static functions (such as 'new') shouldn't be callable from a subclass. For example:

Foo: class {
  init: func
}

Bar: class {
  init: func (a: Int)
}

Foo new() // builds a Foo
Bar new(42) // builds a Bar
Bar new() // compilation error - previously used to (erroneously) build a Foo instead.