[Wish] keyword super lack of error reporting

Discuss the future of the AutoHotkey language
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

[Wish] keyword super lack of error reporting

Post by swagfag » 29 May 2021, 10:17

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'

Return to “AutoHotkey Development”