The parser didn't support 'new' as identifier in this context.
The CL also adds the reporting of tear-offs as metadata for the CFE.
This was already handled by the analyzer.
Change-Id: I7ab5868fa83e5f216d0e7be7ae9cec4a2c865e80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364480
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Add a more specific, but for general use, diagnostic for when the evaluator encounters a type parameter. The errors should match more closely to the CFE errors now.
This CL also tidies up some other areas like `_evaluatePropertyAccess` and produces a better error than `INVALID_CONSTANT` when you try to access something that's not String.length.
Change-Id: I4780e6e52049887a0ee44cdf046968f332527079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322364
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
NamedTypeBuilder is now created with a state that determines whether it
can validly be resolved to an instance type variable.
Change-Id: I1e7f5f8e05a5f68ec18a063476b6cda291a1aca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214643
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Previously, when encountering identifiers in metadata on a class's
type parameter, the analyzer would resolve them using the type
parameter scope, but then fall back on using implicit `this`. The CFE
would resolve them using the class body scope. In both cases, the end
result was that the annotation could refer to static class members.
This change brings the behavior of both the analyzer and the CFE in
line with the spec, by preventing the use of implicit `this` in these
annotations, and resolving them in the type parameter scope.
This is not expected to break any code in practice, because
annotations on type parameters are rare, as are annotations referring
to static class members, and the overlap between these two should be
negligibly small.
Fixes https://github.com/dart-lang/language/issues/1790.
Bug: https://github.com/dart-lang/language/issues/1790
Change-Id: Ibe5a421e04a53d29074a8b1509e1390658ed72e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This CL extends language/metadata/metadata_location_test.dart with a
couple of extra test cases, covering the situation where the metadata
occurs on a type paramater or value parameter of a function type.
Change-Id: I9b225e8c3d72aa5ddd8893526e65ab4d1b5ab2a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187922
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Change-Id: I51105e637b4d0bb0be897c5eba3554ff436d9472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174645
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Adding static methods/getters/setters to class/mixin/extension,
instance getters/setters/operators to mixin/extension, new-syntax
type alias.
Change-Id: I4e3f168d8db9c5f168b138c847bccf948c05c567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168080
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Change-Id: Ibaa2bcd014257c6ec7c756d352e55d48f8a4a902
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167801
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Change-Id: I0243e6112ea3dc31e69a2c1395e08575ab5cb276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149561
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>