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

Unified Diff: docs/language/dartLangSpec.tex

Issue 2704573004: Adjusted spec to outlaw built-in identifiers in type annotations. (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/language/dartLangSpec.tex
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index b0c749c63857c324dccf545ee9f625f1417d66e5..d60e3de7aa491c182888a997ecf27d828752f178 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -5402,7 +5402,9 @@ An {\em identifier expression} consists of a single identifier; it provides acce
\end{grammar}
\LMHash{}
-A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}. It is a compile-time error if a built-in identifier is used as the declared name of a prefix, class, type parameter or type alias. It is a compile-time error to use a built-in identifier other than \DYNAMIC{} as a type annotation or type parameter.
+A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}.
+It is a compile-time error if a built-in identifier is used as the declared name of a prefix, class, type parameter or type alias.
+It is a compile-time error to use a built-in identifier other than \DYNAMIC{} in a type annotation or type parameter.
Lasse Reichstein Nielsen 2017/02/19 11:43:53 The "in" is somewhat vague, but I think it works.
eernst 2017/02/20 08:25:12 Acknowledged!
\rationale{
Built-in identifiers are identifiers that are used as keywords in Dart, but are not reserved words in Javascript. To minimize incompatibilities when porting Javascript code to Dart, we do not make these into reserved words. A built-in identifier may not be used to name a class or type. In other words, they are treated as reserved words when used as types. This eliminates many confusing situations without causing compatibility problems. After all, a Javascript program has no type declarations or annotations so no clash can occur. Furthermore, types should begin with an uppercase letter (see the appendix) and so no clash should occur in any Dart user program anyway.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698