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

Reword error message when including/inheriting generic type without type vars #10206

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

HertzDevil
Copy link
Contributor

When T is a generic, omitting its type vars is not the same as instantiating it with 0 type vars. This PR rewords the error messages in the following cases:

class C(T); end
module M(T); end

class Foo < C
  include M
end

Before:

Error: wrong number of type vars for C(T) (given 0, expected 1)
Error: wrong number of type vars for M(T) (given 0, expected 1)

After:

Error: generic type arguments must be specified when inheriting C(T)
Error: generic type arguments must be specified when including M(T)

@straight-shoota straight-shoota added this to the 1.0.0 milestone Jan 10, 2021
@bcardiff bcardiff merged commit 44f4007 into crystal-lang:master Jan 11, 2021
@HertzDevil HertzDevil deleted the bug/argless-generic-error branch January 12, 2021 07:43
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.

None yet

5 participants