Page 1 of 1

[Wish] keyword super lack of error reporting

Posted: 29 May 2021, 10:17
by swagfag

Code: Select all

#Requires AutoHotkey v2.0-a136-feda41f4

class Parent {
	ExistsButCalledWithMismatchedNumberOfArguments() => ''
}

class Child extends Parent {
	__New() {
		super('a', 'b', 'c') ; doesnt throw, this is unexpected
		super.Call('a', 'b', 'c') ; doesnt throw, this is unexpected
		super.NoSuchMethodExists('a', 'b', 'c') ; doesnt throw, this is unexpected
		; super.ExistsButCalledWithMismatchedNumberOfArguments('a', 'b', 'c') ; throws, this is expected
	}
}

C := Child()
MsgBox 'if u got to here without seeing a msgbox, super.??? failed silently'