We now check that classes and type parameters are not redeclared.
The verify_test also verifies that its test harness has no errors,
as this would make all the other tests useless.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org/2539743002 .
In kernel, library import URIs now have the "app" scheme instead of
the "file" scheme, representing a path relative to the application root.
dartk takes an --app-root flag giving the application root. This
defaults to the current working directory.
The intention is that kernel binaries should not carry irrelevant
path information, such as the path to the home directory of the
user who compiled a given file.
It is not the intention that end-users should see an app URI.
Import paths are currently not shown to users at all, and if we need
to do this, they should be translated to file paths first.
In theory we could stick to file URIs with relative paths, but the Uri
class from dart:core makes this difficult, as certain operations on it
assume that file paths should be absolute.
Source mapping URIs are not yet affected by this change.
R=kmillikin@google.com
Review URL: https://codereview.chromium.org/2532053005 .
- Remove Compiler and Enqueuer arguments from WorkItem.run
- Move show progress from WorkItem.run to Compiler.showXProgress methods
- Move Compiler.analyzeElement to Resolution.computeWorldImpact
- Move Compiler.analyze to ResolutionWorkItem Move Compiler.codegen to CodegenWorkItem
R=het@google.com
Review URL: https://codereview.chromium.org/2531303002 .
Relinquishing execution flow and running event loop after every piece
of work in _FilesReferencingNameTask works, but has too much overhead.
If we instead use a fixed time quantum, we can spend less time overall.
E.g. time to search in analyzer files is 400 microseconds.
R=brianwilkerson@google.com, paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/2535053002 .
Unlike the previous AstFactory (now called AstTestFactory), this class
is not just for testing; it is intended to be able to create all
analyzer AST objects used in production. Also, its methods are
non-static.
For now, all users of the new AstFactory access it using the final
variable `astFactory` in standard_ast_factory.dart. In future CLs I
intend to plumb a reference to the AstFactory through various analyzer
classes so that it can be used in a dependency injection style.
Also, the classes CommentType and UriValidationCodeImpl have been
moved out of the AST implementation file
(pkg/analyzer/lib/src/dart/ast/ast.dart) and to their own files so
that the AST interface will be able to continue to use them without
depending on the AST implementation.
In follow-up CLs I will change the analyzer and its clients to use the
AstFactory rather than the redirecting constructors in the AST
interface file, and then remove those redirecting constructors.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/2522143003 .
We have an error report:
My guess is that `errorCodeByUniqueName` returned `null`.
It might be either a bug in `errorCodeByUniqueName`, or a shortcoming
or our current data version mechanism (which we know about - it should
be a hash of sources or something like this).
Either way, a missing error is better than a crash.
R=paulberry@google.com, brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/2527423002 .
Currently failures on the buildbot will look for example like this:
Short reproduction command (experimental):
python tools/test.py -cdartk -t120 --write-debug-log --write-test-outcome-log --copy-coredumps --exclude-suite pkg language/transitive_private_library_access_test
But developers only would like to see
python tools/test.py -cdartk -t120 language/transitive_private_library_access_test
R=whesse@google.com
Review URL: https://codereview.chromium.org/2532123002 .
This replaces the old --sanity-check flag from dartk. Some files have
been renamed to avoid the wording "sanity check".
Compared to --sanity-check, the following checks have been added:
- variables are not referenced out of scope
- variables are not redeclared
- class type parameters are not referenced from static context
A unit test has been added to check that the verifier rejects certain
invalid ASTs.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org/2531873002 .
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.
It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.
R=floitsch@google.com
Review URL: https://codereview.chromium.org/2467113003 .
Committed: b08fb1373f