Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check abstract def implementations with splats, default values and keyword arguments #9585

Merged
merged 5 commits into from
Jul 22, 2020

Conversation

waj
Copy link
Member

@waj waj commented Jul 7, 2020

Now methods with default arguments are checked that are implemented with the exact same value. In the future this restriction could be relaxed, by making the abstract def to implicitly define an overload with less arguments, just like other methods.

Methods with splats can be implemented exactly as the abstract method defines, but also cases like these are supported:

abstract def foo(*args)
def foo(a = 1, b = 2, *args)
abstract def foo(a : T1, b : T2, *args : T3)
def foo(*args : T1 | T2 | T3)

Keywords arguments are allowed in any order. Extra keyword arguments are allowed if they have a default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants