Commit Graph

3034 Commits

Author SHA1 Message Date
Konstantin Shcheglov 24f61aef20 Report HintCode.MISSING_RETURN for async functions with return type that matters.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2630023003 .
2017-01-15 09:51:26 -08:00
Brian Wilkerson bdb36c9c69 Remaining parser changes for generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2638463002 .
2017-01-14 08:24:03 -08:00
Konstantin Shcheglov 646193e6fb Fix for crash when part directive uri is has null value.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628303002 .
2017-01-12 17:29:13 -08:00
Konstantin Shcheglov 06ebd41d38 Fix assert constructor initializer tests.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628143005 .
2017-01-12 16:56:25 -08:00
Konstantin Shcheglov 914a117649 Report errors like IMPORT_OF_NON_LIBRARY with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2627093010 .
2017-01-12 13:41:52 -08:00
Konstantin Shcheglov 6f840b12fb Fix for test_uriDoesNotExist_import_disappears_when_fixed().
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2622133007 .
2017-01-12 09:50:12 -08:00
Paul Berry c6206ea1de Split "_Driver" tests to separate test files.
This avoids timeouts on my machine.  Also it makes it easier to disable these tests when necessary.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2627293002 .
2017-01-12 08:19:19 -08:00
Brian Wilkerson e7577172d1 Add preliminary parser support for generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2628973003 .
2017-01-12 07:00:24 -08:00
Konstantin Shcheglov e7ee8db44c Run the rest of the analysis tests with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2625203002 .
2017-01-11 14:32:21 -08:00
Brian Wilkerson 22f561e914 Reapply "Add support for generic function type syntax, part 1"
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2622303006 .
2017-01-11 14:10:05 -08:00
Konstantin Shcheglov 9d240f8fb1 Replace reset() arguments with resetWith() invocation.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2627083003 .
2017-01-11 13:37:22 -08:00
Konstantin Shcheglov be0ce86f43 Run more analysis tests with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628083002 .
2017-01-11 13:35:46 -08:00
Brian Wilkerson 85b1e7abbe Revert "Add support for generic function type syntax, part 1"
Review-Url: https://codereview.chromium.org/2624283003 .
2017-01-11 13:30:52 -08:00
Brian Wilkerson 1cd918533d Add support for generic function type syntax, part 1
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2613383003 .
2017-01-11 13:12:10 -08:00
Konstantin Shcheglov e197fd81ba Replace same() with equals() in TypeAssertions.
R=brianwilkerson@google.com, leafp@google.com
BUG=

Review-Url: https://codereview.chromium.org/2623283002 .
2017-01-11 12:55:04 -08:00
Konstantin Shcheglov 799296e92b Extract x_Driver tests that time out on Windows bots.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2623253003 .
2017-01-11 11:49:34 -08:00
Konstantin Shcheglov 31f08c798a Don't instantiate a new InterfaceTypeImpl for a ClassElement without type parameters.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628013002 .
2017-01-11 11:15:40 -08:00
Konstantin Shcheglov dae3b69321 Fix the test on Windows.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2625143002 .
2017-01-11 09:39:22 -08:00
Konstantin Shcheglov 41f8d695b0 Fix an analysis error in tests.
TBR

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2622323002 .
2017-01-11 09:22:14 -08:00
Konstantin Shcheglov 73e7da4976 Run the most of error generating tests with the new analysis driver.
Some tests have more failures than I feel comfortable marking as failing.
I will triage them in following CLs.

StaticTypeAnalyzer2Test
StrictModeTest
StrongModeDownwardsInferenceTest
StrongModeStaticTypeAnalyzer2Test
TypePropagationTest

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2628743002 .
2017-01-11 08:25:21 -08:00
Konstantin Shcheglov 65ff5b5e50 Explicitly compute analysis results for sources to check errors.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2625783002 .
2017-01-10 12:58:58 -08:00
Konstantin Shcheglov 5a3afed30f Make error producing tests ansynchronous.
This is another preliminary test to run these tests with the new
analysis driver. Especially when we're going to replace the task based
analysis implementation with another one.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2624793002 .
2017-01-10 10:33:44 -08:00
Konstantin Shcheglov b5c5c1c222 Remove computeLibrarySourceErrors().
All errors are computed and validated in assertErrors().

In a 3 tests assertErrors() for the library was mved before the call
for a part to ensure library/part link establishment.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2626653002 .
2017-01-10 08:44:48 -08:00
Jennifer Messerly 816592a941 fixes #28236, generic methods should not cause warnings in Dart 1
Instantiate universal functions in subtype tests & tear-offs. Also updates the status files and one Analyzer test that covered the tear-off type.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2621433003 .
2017-01-09 12:46:20 -08:00
Leaf Petersen 83fc4b6b46 Put a TypeProvider on the TypeSystem implementations.
Adding a TypeProvider instance to TypeSystem to avoid needing to
thread it through the various APIs, and to avoid having to change
the API every time a method which previously did not need to
access the TypeSystem suddenly does.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2590883004 .
2017-01-09 02:40:10 -08:00
Paul Berry 02fe40c6f7 Simplify how patch files are specified to analyzer.
After discussion with kmillikin@, sigmund@, and scheglov@, we decided
that specifying the patch files in libraries.dart is more complex (and
less flexible) than we'd like.  This CL changes things so that the
patch files are specified in analysis options using a simple map from
library name (e.g. "dart:core") to a list of patch file paths.

Clients are now allowed to put patch files wherever they want; they
don't need to be inside the sdk directory.

Note that we no longer include the patch configuration in
encodeCrossContextOptions.  This should be ok, since we don't have any
use case in which a single instance of analyzer needs to accommodate
multiple patch configurations.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2560323002 .
2016-12-12 10:15:18 -08:00
Brian Wilkerson 86c62a6bad Remove the command-line plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2565993002 .
2016-12-11 10:59:19 -08:00
Brian Wilkerson a01afcd1d1 Remove the options plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2569603002 .
2016-12-11 08:38:29 -08:00
Brian Wilkerson e22a2b4626 Enable messages in asserts by default
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2557513008 .
2016-12-07 12:23:00 -08:00
Paul Berry ae6fd961a1 Prepare for decoupling analyzer ASTs from element model.
This CL creates top level accessor functions which may be used to map from AST data structures to their corresponding elements and types, and begins using those accessor functions throughout the SDK.  It also adds empty interfaces ResolutionTarget and ResolutionType, which are implemented by Element and DartType respectively.

In a future CL, I will change the types stored in the AST to ResolutionTarget and ResolutionType, rather than specific element types; this will decouple the ASTs from the element model.  The presence of the accessor functions will allow clients to continue accessing elements and types in a type-safe way.

R=asgerf@google.com, brianwilkerson@google.com, scheglov@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/2551023005 .
2016-12-07 11:08:14 -08:00
Andrew Lorenzen c9d7a5a5c8 Make Element.accept() generic. (#27690)
* Make Element.accept() generic.

* Update subclasses of Element.
2016-12-06 20:42:00 +01:00
Brian Wilkerson b4820d6a63 Handle generic local functions without a return type (issue 27965)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2551533002 .
2016-12-02 10:50:21 -08:00
Jennifer Messerly 7a1b6e75b3 restrict generic function type subtyping
R=leafp@google.com

Review URL: https://codereview.chromium.org/2540903003 .
2016-12-01 19:24:15 -08:00
Paul Berry 0c31815f1c Transition analyzer and analysis_server to new astFactory.
This is the same as 1d028eed8d (which
was reverted) except that it doesn't remove the old AST factory
constructors (which broke dev_compiler).  The removal of old AST
factory constructors will be done in a follow-up CL so that if it
unexpectedly breaks any other clients we will be able to revert it
without reverting this CL.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2536373008 .
2016-12-01 10:56:21 -08:00
Vijay Menon b8d3758dcd Revert "Transition analyzer and analysis_server to new astFactory; remove old AST factory methods."
This reverts commit 1d028eed8d.

This was breaking DDC.

TBR=paulberry@google.com

Review URL: https://codereview.chromium.org/2542753002 .
2016-11-30 14:57:49 -08:00
Paul Berry 1d028eed8d Transition analyzer and analysis_server to new astFactory; remove old AST factory methods.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2539243002 .
2016-11-30 12:28:51 -08:00
Brian Wilkerson 37387de83a Exclude files from analysis when using AnalysisDriver
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2536303002 .
2016-11-29 13:30:22 -08:00
Brian Wilkerson 7e067a6fc8 Enable read-only access to initializing formals (issue 27895)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2532953004 .
2016-11-29 07:46:28 -08:00
Brian Wilkerson b923dafd25 Add parser support for using a URI in a part-of directive
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2526063002 .
2016-11-25 08:16:45 -08:00
Paul Berry 05a6045674 Rename AstFactory -> AstTestFactory.
This paves the way for introducing a new AstFactory class that will be
part of the analyzer public API.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2524903002 .
2016-11-22 16:09:51 -08:00
Brian Wilkerson e63105555b Remove uses of configuration data
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2522543007 .
2016-11-22 11:26:08 -08:00
Brian Wilkerson a3e1a0d395 Enable generic method support by default
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2488043002 .
2016-11-22 09:16:19 -08:00
Konstantin Shcheglov 4f1fa54e34 Fix for Import/ExportDirective annotations while applying resynthesized element model.
This takea care of the Pub analysis crash you saw.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2508223004 .
2016-11-18 15:05:59 -08:00
Paul Berry c6ad6fa114 When analyzing a Bazel/Blaze workspace in which no build has been run, assume Bazel.
Previously we were returning `null`, causing all package resolution to fail.

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2506753002 .
2016-11-16 09:52:35 -08:00
Paul Berry 7336101b28 Change BazelWorkspace so that it checks the main source directory before READONLY.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2502103003 .
2016-11-15 15:21:47 -08:00
Paul Berry 1c2268b13e Move scanner tests into the front_end package.
This required moving the following classes into front_end as well:
- CharSequenceReader
- SubSequenceReader
- JenkinsSmiHash

A small amount of the functionality of GatheringErrorListener and
AnalysisError had to be replicated, to avoid a dependency on the
analyzer package.  In a future CL I will either refactor this code to
make it available to the rest of the front end, or, if
GatheringErrorListener and AnalysisError wind up getting moved into
the front end, I will un-do the replication.

I also took the liberty of addition functionality to JenkinsSmiHash to
make it easier to use.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2508483002 .
2016-11-15 14:53:49 -08:00
Paul Berry 0c928771fc Revert "Connect analyzer's AnalysisError object to front_end's CompilationError."
This reverts commit fc5270df72.

TBR=scheglov@google.com, brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2503803003 .
2016-11-15 10:00:34 -08:00
Paul Berry fc5270df72 Connect analyzer's AnalysisError object to front_end's CompilationError.
AnalysisError implements CompilationError but provides additional
services, such as extensibility via the `getProperty` method.

Note: CompilationError.location has been renamed to
CompilationError.span to avoid confusion (since its type is
`SourceSpan`, not `SourceLocation`).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2498133002 .
2016-11-14 15:30:10 -08:00
Brian Wilkerson 40cbb6ec15 Disable the hint produced when invoking a super member that is abstract when super-in-mixins is supported
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2500143002 .
2016-11-14 13:51:35 -08:00
Konstantin Shcheglov b2c94a8a89 Issue 27689. Fix incremental resolution with body modifiers changes.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27689

Review URL: https://codereview.chromium.org/2498873004 .
2016-11-14 11:06:35 -08:00