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

Issue 1915123008: Implements support for ignoring method type arguments in resolution. (Closed)

Created:
4 years, 7 months ago by eernst
Modified:
4 years, 7 months ago
Reviewers:
Johnni Winther
CC:
reviews_dartlang.org, floitsch
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Implements support for ignoring method type arguments in resolution. Extends `FunctionExpression` to hold the formal type variable declaration syntax. Introduces `GenericElement` as a new superclass of `TypeDeclarationElement`, allowing `FunctionElement` to have a getter `typeVariables`. Changes `SignatureResolver.analyze` in several ways to create and handle the new type variables. In order to avoid circular ordering dependencies, introduced new scope classes such that the function signatures can be computed without relying on themselves to look up type variables (e.g., `FunctionSignatureBuildingScope`). Finally, the mock_compiler and resolver_test.dart were adjusted to give a `scope` argument to `new ResolverVisitor(..)` in order to get the correct scopes in the new setup. A few words about the approach: The type of every method type parameter behaves as `dynamic`, because its bound is (unconditionally, ignoring any bound syntax that might be present) set to `const DynamicType()`. This preserves the property that diagnostic messages about the type variables will refer to the correct location in the source code. Type arguments passed in send expressions are parsed but not added to the abstract syntax and therefore not passed on to the resolution phase; this means that all sends are treated as if they had no actual type arguments, even when they do have them. Hence, actual method type arguments are completely ignored. R=johnniwinther@google.com Committed: https://github.com/dart-lang/sdk/commit/e44e667ca7a57eb98050b43c3d6b084c1604a3bd

Patch Set 1 #

Total comments: 10

Patch Set 2 : Review response #

Patch Set 3 : Rebased unto current master #

Patch Set 4 : Rebased again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+265 lines, -94 lines) Patch
M pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart View 4 chunks +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/elements/elements.dart View 1 2 8 chunks +26 lines, -14 lines 0 comments Download
M pkg/compiler/lib/src/elements/modelx.dart View 1 2 9 chunks +26 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/parser/node_listener.dart View 5 chunks +13 lines, -13 lines 0 comments Download
M pkg/compiler/lib/src/resolution/enum_creator.dart View 3 chunks +5 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/resolution/members.dart View 1 2 8 chunks +24 lines, -12 lines 0 comments Download
M pkg/compiler/lib/src/resolution/resolution.dart View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/resolution/scope.dart View 1 3 chunks +24 lines, -12 lines 0 comments Download
M pkg/compiler/lib/src/resolution/signatures.dart View 1 7 chunks +50 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/resolution/type_resolver.dart View 1 2 chunks +7 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/resolution/typedefs.dart View 1 chunk +7 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/serialization/modelz.dart View 1 2 3 chunks +9 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart View 2 chunks +2 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/tree/nodes.dart View 5 chunks +14 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 4 chunks +22 lines, -6 lines 0 comments Download
M tests/compiler/dart2js/resolver_test.dart View 1 2 6 chunks +26 lines, -20 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
eernst
First dart2js with reasonably complete support for generic method syntax: parses the new constructs except ...
4 years, 7 months ago (2016-04-28 14:57:05 UTC) #2
Johnni Winther
lgtm https://codereview.chromium.org/1915123008/diff/1/pkg/compiler/lib/src/elements/elements.dart File pkg/compiler/lib/src/elements/elements.dart (right): https://codereview.chromium.org/1915123008/diff/1/pkg/compiler/lib/src/elements/elements.dart#newcode1571 pkg/compiler/lib/src/elements/elements.dart:1571: /// The class, typedef, function, or method on ...
4 years, 7 months ago (2016-04-29 07:21:06 UTC) #3
eernst
Review response. https://codereview.chromium.org/1915123008/diff/1/pkg/compiler/lib/src/elements/elements.dart File pkg/compiler/lib/src/elements/elements.dart (right): https://codereview.chromium.org/1915123008/diff/1/pkg/compiler/lib/src/elements/elements.dart#newcode1571 pkg/compiler/lib/src/elements/elements.dart:1571: /// The class, typedef, function, or method ...
4 years, 7 months ago (2016-04-29 13:24:50 UTC) #4
eernst
4 years, 7 months ago (2016-04-29 17:46:24 UTC) #6
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
e44e667ca7a57eb98050b43c3d6b084c1604a3bd (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698