Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(13)

## Issue 1177073002: An attempt to add generic methods to the spec. This is just a draft for purposes of evaluation and …

Created:
5 years, 3 months ago by gbracha
Modified:
5 years, 2 months ago
Reviewers:
Leaf, Brian Wilkerson
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
Visibility:
Public.

### Description

An attempt to add generic methods to the spec. This is just a draft for purposes of evaluation and experimentation. It does not entail any commitment to the feature in any particular time frame. Keep calm! BUG=

### Patch Set 5 : s = 0 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -65 lines) Patch
M docs/language/dartLangSpec.tex View 1 2 3 4 59 chunks +231 lines, -65 lines 8 comments Download

### Messages

Total messages: 10 (2 generated)
Leaf
 Hi Gilad - Great to see this start to get fleshed out! I put a ...
5 years, 3 months ago (2015-06-16 23:23:10 UTC) #2
gbracha
 PTAL. I'll send you a PDF as well. https://codereview.chromium.org/1177073002/diff/20001/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/1177073002/diff/20001/docs/language/dartLangSpec.tex#newcode3671 docs/language/dartLangSpec.tex:3671: If ...
5 years, 3 months ago (2015-06-18 20:05:59 UTC) #3
Brian Wilkerson
 Initial thoughts on the grammar. I'll try implementing it soon to see whether there are ...
5 years, 3 months ago (2015-06-21 23:32:02 UTC) #5
Leaf
 A few more comments, thanks! https://codereview.chromium.org/1177073002/diff/20001/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex (right): https://codereview.chromium.org/1177073002/diff/20001/docs/language/dartLangSpec.tex#newcode3677 docs/language/dartLangSpec.tex:3677: 2. If there are ...
5 years, 2 months ago (2015-06-23 02:00:00 UTC) #6
gbracha
 Looks like my previous batch of changes wasn't uploaded before. It now matches the PDF ...
5 years, 2 months ago (2015-06-23 20:26:24 UTC) #7
gbracha 5 years, 2 months ago (2015-06-23 20:34:46 UTC) #8
Leaf
 A couple more comments based on another read through of the latest. https://codereview.chromium.org/1177073002/diff/80001/docs/language/dartLangSpec.tex File docs/language/dartLangSpec.tex ...
5 years, 2 months ago (2015-06-26 20:54:31 UTC) #9
Leaf
 Some suggestions about where to put the restrictions on type arguments to stop universal types ...
5 years, 2 months ago (2015-06-26 22:32:17 UTC) #10
Some suggestions about where to put the restrictions on type arguments to stop
universal types from being instantiated with other universal types.  Not sure if
I caught all of them, or if there might not be a more central location to unify
them in?

https://codereview.chromium.org/1177073002/diff/80001/docs/language/dartLangS...
File docs/language/dartLangSpec.tex (right):

https://codereview.chromium.org/1177073002/diff/80001/docs/language/dartLangS...
docs/language/dartLangSpec.tex:2193: A type parameter $T$ may be suffixed with
an \EXTENDS{} clause that specifies the {\em upper bound} for $T$. If no
\EXTENDS{} clause is present, the upper bound is \code{Object}.  It is a static
type warning if a type parameter is a supertype of its upper bound. The bounds
of type variables are a form of type annotation and have no effect on execution
in production mode.
It is a static warning if the bound of a type parameter is a universal type.

https://codereview.chromium.org/1177073002/diff/80001/docs/language/dartLangS...
docs/language/dartLangSpec.tex:3683: Otherwise,  $r = s$, then each formal type
parameter is bound to the corresponding type argument.
Generic restriction: If A_i is a universal type, then it is replaced with
\DYNAMIC.

https://codereview.chromium.org/1177073002/diff/80001/docs/language/dartLangS...
docs/language/dartLangSpec.tex:3897:
Generic restriction: If A_i is a universal type, then it is replaced with
\DYNAMIC.

https://codereview.chromium.org/1177073002/diff/80001/docs/language/dartLangS...
docs/language/dartLangSpec.tex:4009:
Generic restriction: If A_i is a universal type, then it is replaced with
\DYNAMIC.

https://codereview.chromium.org/1177073002/diff/80001/docs/language/dartLangS...
docs/language/dartLangSpec.tex:7549: Let $T$ be a parameterized type  $G<S_1, \ldots, S_n>$. If $G$ is not a generic type, the type arguments $S_i$, $1 \le i \le n$ are discarded. If $G$ has $m \ne n$ type parameters, $T$ is treated as as
a parameterized type with $m$ arguments, all of which are \DYNAMIC{}.
Restriction on generic parameters: If S_i is a universal type, then it is
treated as if it were dynamic (and a static warning is issued).

This is Rietveld 408576698