In order to avoid having to reconstitute the entire element model when
deserializing a library summary, we'll need to be able to create element
handles for any elements referenced by the library. Since element
handles operate using a "location", and the "location" records
information about the compilation unit containing the element, this
means that the library summary needs to track which unit each referenced
element lives in (even though this information would otherwise not be
semantically relevant).
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1468583002 .
Instead of passing around opaque Objects which are the result of
calling the Builder.finish() methods, we pass around the Builder
objects themselves, and we call finish() from within the generated
code. This pushes the lack of type safety into the generated code,
leaving the handwritten code type safe.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1452363002 .
- If a package has an '_embedder.yaml' file with an 'embedder_libs' key two things happen:
1) We do not use the DartUriResolver to resolve dart: libraries.
2) We use the EmbedderUriResolver to resolve all dart: libraries
- If multiple packages have an '_embedder.yaml' file we merge them.
- This might not be the final behaviour that we want but I'm not sure how to surface errors to the end user.
- The '_embedder.yaml' file has a top level key 'embedder_libs' which is a map from dart: library uri to source path. Other keys are ignored by the EmbedderUriResolver.
- Unit tests for analyzer
- Integration test for analysis_server.
R=pquitslund@google.com
Review URL: https://codereview.chromium.org/1437893003 .
Its "in stack" percent is down from 2.82% to 0.16% now.
This makes total MDL project analysis about 3% faster.
Also exchange the 'suffix' arguments to make them consistent with the parent/child order everywhere else.
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1444983002 .
The big change here is to ensure FunctionTypeImpl.typeArguments is always initialized to match the parameters. This was previously the case, because we'd explicitly use the class's type parameters. With generic methods, we can no longer rely exclusively on that source of type parameters.
We take advantage of enclosingElement to compute typeParameters from all containing scopes that can have them. By tracking all of the typeParameters, this allows substitution to work later.
Adds a few very basic tests. Please note that generic methods are not ready to use yet.
In particular this doesn't yet do the correct substitutions in StaticTypeAnalyzer. It also doesn't include (mostly done) inference to infer type parameters from the argument types. Further, discovered a missing feature from the previous parser CL. And finally, it doesn't include the kind of ErrorVerifier checks we'll likely need.
R=brianwilkerson@google.com, leafp@google.com
Review URL: https://codereview.chromium.org/1434983006 .
The good news is that I reproduced a server issue; the bad news is I landed a change with unnoticed static warnings! :/
(This fixes them.)
BUG=
Review URL: https://codereview.chromium.org/1441763002 .
also sorted members per analyzer style (?)
figured it would be easier to work on as a 0.5k file vs ~15k resolver.dart :)
For now I left TypeProvider where it was. Not sure if it should move here or into its own file as well.
For backwards compat, all of the types are re-exported from resolver.dart.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1407923009 .
Basic YAML map merging suitable for merging a default map with an overriding one.
The semantics favor the overrider with a twist to support a short-hand for lists that stand-in for maps of scalars to booleans. Specifically, lint rules can be enumerated as a list or as a map. To make this work, lists can be "promoted" to maps. In particular, if
linter:
rules:
- camel_case_types
- one_member_abstracts
is merged with
linter:
rules:
one_member_abstracts: false
always_specify_return_types: true
the right thing is done to get us to:
linter:
rules:
camel_case_types: true
one_member_abstracts: false
always_specify_return_types: true
R=brianwilkerson@google.com, johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1425393002 .