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

Unified Diff: runtime/vm/parser.cc

Issue 2063223003: Type parameters and class members must not conflict (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: wip Created 4 years, 6 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 | tests/co19/co19-co19.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 2be86b948d5e585a3bea3c26cf6c4de549078218..9cd04a3f032ec97746e0053492738ae93d5cc91c 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4677,6 +4677,11 @@ void Parser::ParseClassDefinition(const Class& cls) {
}
ExpectToken(Token::kRBRACE);
+ if (cls.LookupTypeParameter(class_name) != TypeParameter::null()) {
+ ReportError(class_pos,
+ "class name conflicts with type parameter '%s'",
+ class_name.ToCString());
+ }
CheckConstructors(&members);
// Need to compute this here since MakeArray() will clear the
« no previous file with comments | « no previous file | tests/co19/co19-co19.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698