Consider the following programs:
class Function {}
class C<Function> {}
void main() {}
typedef Function = int;
typedef F<Function> = int;
void main() {}
extension Function on List {}
extension E<Function> on List<Function> {}
void main() {}
mixin Function {}
mixin M<Function> implements List<Function> {}
void main() {}
The word Function is a built-in identifier, but it is not consistently reported as an error when this word is used as the name of a type (that is, a class, type parameter, type alias, etc.).
No errors or other diagnostics are emitted except for the following:
- The analyzer hints that a class named
Function is deprecated.
- The analyzer and the CFE emit an error "'Function' can't be used as an identifier because it's a keyword" on
typedef Function = int;.
All declaring occurrences of Function should be marked as a compile-time error.
Consider the following programs:
The word
Functionis a built-in identifier, but it is not consistently reported as an error when this word is used as the name of a type (that is, a class, type parameter, type alias, etc.).No errors or other diagnostics are emitted except for the following:
Functionis deprecated.typedef Function = int;.All declaring occurrences of
Functionshould be marked as a compile-time error.