Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 25023002: Emit a compile-time error if a function type parameter is declard with 'final' or 'var'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index aba2213c581e3c1b60005ae7c3cca65202e2c4c1..114e74f8ba21a20b896d2a82104c006ab48fb0a6 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -4127,6 +4127,14 @@ class SignatureResolver extends CommonResolverVisitor<Element> {
}
Element visitFunctionExpression(FunctionExpression node) {
+ Modifiers modifiers = currentDefinitions.modifiers;
+ if (modifiers.isFinal()) {
+ compiler.reportError(modifiers,
+ MessageKind.FINAL_FUNCTION_TYPE_PARAMETER);
+ }
+ if (modifiers.isVar()) {
+ compiler.reportError(modifiers, MessageKind.VAR_FUNCTION_TYPE_PARAMETER);
+ }
// This is a function typed parameter.
// TODO(ahe): Resolve the function type.
return visit(node.name);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698