Skip to content

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Jun 8, 2021

The current text in the section 'Type Aliases' in the language specification implies that it is possible to invoke a static method staticMethod of a class C via a type alias F with type arguments:

class C<X> {
  void staticMethod() {}
}
typedef F<X> = C<X>;

void main() {
  F<int>.staticMethod();
}

This should be an error, and the tests expect that it is an error, but the spec language said otherwise. This PR changes the spec text to follow the intention and tests, and makes it an error to include type arguments in this kind of static method invocation.

It also changes the grammar such that a type alias can denote a <type> rather than just a <functionType>, hence "enabling" non-function type aliases in general.

@eernstg eernstg requested a review from lrhn June 8, 2021 10:33
@eernstg eernstg changed the title Adjust 'Type Aliases' to outlaw explicit type arguments to static method Adjust 'Type Aliases' to outlaw explicit type arguments in static method call Jun 8, 2021
@eernstg eernstg merged commit 238a752 into master Jun 8, 2021
@eernstg eernstg deleted the specify_alias_staticMethod_jun21 branch June 8, 2021 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants