SOMns icon indicating copy to clipboard operation
SOMns copied to clipboard

Assertion instead of Error when inheriting from instance instead of class

Open smarr opened this issue 7 years ago • 0 comments

The following program causes an assertion, instead of a language-level error:

class InheritFromInstance usingPlatform: platform = Value ()(
  class AOb = getSuper ()()

  private getSuper = (
    ^ Object new
  )

  public main: args = (
    | b = objL getSuper ()(). |
    AOb new.

    ^ 0
  )
)

The solution would be to add proper checks instead of relying on assertions. If the checks fail, we would need to signal a proper language-level error.

smarr avatar Feb 14 '18 07:02 smarr