Commit Graph

1447 Commits

Author SHA1 Message Date
Konstantin Shcheglov 7aa9b301e5 Fix for 'const C.named()' type inference when 'C' is resolved and has type parameters, but 'named' is unresolved.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2735033002 .
2017-03-07 08:49:05 -08:00
Konstantin Shcheglov 686a60aacf Verify resynthesized elements by comparing text presentations.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2728883004 .
2017-03-03 18:26:16 -08:00
Dmitry Stefantsov 9c340f9eb1 Revert last 4 commits by @lrn
Reverted commits:
* ef097edad6. ("Make Analyzer, VM and
  dart2js accept URI strings as part-of library identifier.")
* e8e1857814. ("Fix bad example of URI
  part-of to be bad, not good.")
* 58f7a92ede. ("Add changelog entry for
  allowing URI in part-of.")
* a4a7d98dce. ("Use FutureOr in
  Completer.complete.")

TBR=lrn@google.com

Review-Url: https://codereview.chromium.org/2724853002 .
2017-03-01 16:44:52 +01:00
Lasse R.H. Nielsen ef097edad6 Make Analyzer, VM and dart2js accept URI strings as part-of library identifier.
R=brianwilkerson@google.com, floitsch@google.com, hausner@google.com, johnniwinther@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2640853005 .
2017-03-01 12:15:11 +01:00
danrubel ea4b380f80 fix source restoreUri test
Review-Url: https://codereview.chromium.org/2717933002 .
2017-02-26 15:18:38 -08:00
danrubel 00e705835d revert restoreUri test on Windows
Review-Url: https://codereview.chromium.org/2719803002 .
2017-02-26 14:52:46 -08:00
danrubel 4ca5ac929a fix MemoryResourceProvider context on Windows
On Windows, the MemoryResourceProvider.convertPath method
prefixes the path with the C: drive, but the context associated with
the MemoryResourceProvider has a drive letter based upon the underlying
current directory. Most of the time, these two drive letters are the
same, but sometimes, such as on the Windows bot, the current working
directory is on drive E:, rather than drive C:.
This causes package Uris to be mapped to drive E: rather than the
expected drive C:

This CL changes the MemoryResourceProvider constructor
to set the current working directory to C:\ when running on Windows
so that it aligns with MemoryResourceProvider.convertPath.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2714373002 .
2017-02-26 13:30:42 -08:00
danrubel 940fe975a8 Revert "debug MemoryResourceProvider on Windows"
This reverts commit a0ec77e383.

Review-Url: https://codereview.chromium.org/2716153002 .
2017-02-26 08:50:09 -08:00
danrubel a0ec77e383 debug MemoryResourceProvider on Windows
Review-Url: https://codereview.chromium.org/2719793002 .
2017-02-26 08:23:18 -08:00
danrubel 339d32e500 Revert "debug ContextBuilder getAnalysisOptions on Windows"
This reverts commit eb363eaa13.

Review-Url: https://codereview.chromium.org/2712303002 .
2017-02-26 08:13:03 -08:00
danrubel eb363eaa13 debug ContextBuilder getAnalysisOptions on Windows
Review-Url: https://codereview.chromium.org/2720583002 .
2017-02-26 07:45:56 -08:00
danrubel 0be4408efa Revert "debug analyzer test on windows"
This reverts commit 7582a9dc27.

Review-Url: https://codereview.chromium.org/2719673003 .
2017-02-25 12:43:21 -05:00
danrubel 7582a9dc27 debug analyzer test on windows
Review-Url: https://codereview.chromium.org/2717873002 .
2017-02-25 11:59:22 -05:00
danrubel acd7a294e5 Revert "debug Windows tests"
This reverts commit 3bf53bdb0a.

Review-Url: https://codereview.chromium.org/2717783003 .
2017-02-25 11:55:29 -05:00
danrubel 3bf53bdb0a debug Windows tests
Review-Url: https://codereview.chromium.org/2714883005 .
2017-02-25 10:57:12 -05:00
Konstantin Shcheglov 123c8a9668 Fix for serializing cascades with not-assignment access to properties.
This was triggering a small avalanche of inference failures internally.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2711423002 .
2017-02-24 12:59:48 -08:00
Konstantin Shcheglov 392a9c5bb2 Work around the problem when type inference fails and StrongTypeSystemImpl.inferGenericFunctionCall() returns null.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2712913004 .
2017-02-24 12:47:20 -08:00
Konstantin Shcheglov 3d88437bda Add AST factories for formal parameters with all optional named parameters.
Also add 'covariantKeyword' to the Impl constructors and named factories.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2713173003 .
2017-02-24 12:09:43 -08:00
Konstantin Shcheglov ddddb2c50d Revert "Add NormalFormalParameter.covariantKeyword setter and factory parameter."
This reverts commit 57b78f422e.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2710393002 .
2017-02-23 21:22:00 -08:00
Konstantin Shcheglov 57b78f422e Add NormalFormalParameter.covariantKeyword setter and factory parameter.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2714843002 .
2017-02-23 14:48:57 -08:00
Konstantin Shcheglov 48714187b3 Run src/task/strong tests with analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2715533008 .
2017-02-23 14:13:51 -08:00
Konstantin Shcheglov f19f6d8ca6 Always return computed errors, even for not added files.
There is no penalty for computing it, we have already computed, it is
just a matter of returning them or not.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2709633009 .
2017-02-23 13:55:32 -08:00
danrubel 289888cd0e enhance ContextBuilder getAnalysisOptions to handle lints
This updates ContextBuilder to process the --lints command line option:
* --[no-]lints enables (or disables) lints
* if --lints but no lints specified in analysis options
    then the default set of lints is used
* if --no-lints then lints are turned off
    regardless of what is specified in the analysis options
* if neither --lints nor --no-lints are specified
    then lints are turned on iff analysis options specifies lints

My next step is to update analyzer_cli to use ContextBuilder getAnalysisOptions

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2716693003 .
2017-02-23 16:23:43 -05:00
Konstantin Shcheglov 7a321225f0 Make src/task/strong tests into classes and asynchronous.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2705323005 .
2017-02-23 12:54:09 -08:00
Konstantin Shcheglov 02da0fb1dd Issue 28862. Implement type inference for invokeConstructor with field formal parameter.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28862

Review-Url: https://codereview.chromium.org/2710943007 .
2017-02-23 10:48:02 -08:00
Konstantin Shcheglov 7358288e21 Issue 28862. Implement type inference for invokeConstructor.
Not fully fixed yet, we don't work well with 'this.x' in constructor and
type inference. Will look in the next CL.

R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/28862

Review-Url: https://codereview.chromium.org/2711733003 .
2017-02-23 09:59:50 -08:00
Konstantin Shcheglov 94556d578d Remove AnalysisErrorWithProperties and ErrorProperty.
It was not used in Analysis Server for some time, and we cannot use
it for any practical purpose with the new analysis driver.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2706123002 .
2017-02-20 15:13:42 -08:00
Konstantin Shcheglov e353acf1c9 Don't sent errors for general files if the file has the same signature.
The signature is not in AnalysisResult, not used anywhere outside the
the driver itself yet. Do we want it for consistency with UnitElementResult?
Or make private until someone asks?

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2703983002 .
2017-02-18 12:20:42 -08:00
Konstantin Shcheglov f224ebda5c Use absolute URIs for LinkedDependency.uri/parts.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2700843002 .
2017-02-16 14:59:14 -08:00
Konstantin Shcheglov ab8aea145e Remove PubSummaryManager.
The new AnalysisDriver is more general approach

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2698133002 .
2017-02-16 06:58:07 -08:00
Konstantin Shcheglov f47ebbcea3 Add CompilationUnitElement.lineInfo and resynthesize it.
One bit that is not quite straight is that UnlinkedUnit.lineInfo is
empty. Normally we would have [0] for empty files, which we pretend
missing files are. Should we fix this instead of checking in the
resynthesizer?

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2694403003 .
2017-02-15 09:54:28 -08:00
Konstantin Shcheglov 95df49001d Fixes for referenced names computing.
1. Hide using constructor parameter names.
2. Don't hide names of named expressions.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2689343003 .
2017-02-14 08:56:53 -08:00
Konstantin Shcheglov e3380d2f67 Run InstanceMemberInferrerTest with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2697443003 .
2017-02-13 13:31:31 -08:00
Konstantin Shcheglov 126b10adf8 Add AnalysisDriver.getUnitElementSignature() for checking without resynthesizing.
Just like _computeAnalysisResult() uses _getResolvedUnitKey() to check
cache for existing results without _createLibraryContext(), we need
Angular plugin to use getUnitElementSignature() to check whether there
are existing analysis results.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2692073002 .
2017-02-13 12:45:14 -08:00
Brian Wilkerson f364eb1ab8 Possible fix for 28038
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2681153002 .
2017-02-13 07:50:45 -08:00
Konstantin Shcheglov 65559748eb AnalysisDriver.getUnitElement() should return a structure with a key.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2691433008 .
2017-02-12 14:57:57 -08:00
Konstantin Shcheglov f64b1d4067 If no valid type arguments, instantate function type alias to bounds in resynthesizer.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2688223002 .
2017-02-10 13:09:52 -08:00
Konstantin Shcheglov 4af7939d25 Fix export + local when the library is also exported.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2689573002 .
2017-02-09 10:13:22 -08:00
Konstantin Shcheglov a21fe1120a When a name is both exported and defined locally, the name is defined.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2678273007 .
2017-02-09 08:32:41 -08:00
Konstantin Shcheglov 832f10e589 Don't re-read files when compute their analysis results.
We don't really need this.
The client must notify us that the file was changed.
Then we will re-read it.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2686843003 .
2017-02-08 19:21:12 -08:00
Paul Berry 67463b0f7d Make some parser test helper methods non-static.
This paves the way for allowing more of analyzer's parser tests to be
run on both Fasta's parser and the analyzer parser.

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

Review-Url: https://codereview.chromium.org/2683543006 .
2017-02-08 08:24:55 -08:00
Konstantin Shcheglov fe3286ad4b Resolve Library/Part/PartOf/Directive(s) in AST without tasks.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2680883004 .
2017-02-07 18:20:39 -08:00
Konstantin Shcheglov b474d42e30 Compute constants in non-task analyzer.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2679073003 .
2017-02-07 09:09:48 -08:00
Konstantin Shcheglov 236321245d Not task based analysis.
Work in progress.

Constants are not evaluated.

Operations, like URI resolution, type resolution, etc are not optimized.

I'd like to land some initial state and then start iterating.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2678193002 .
2017-02-06 16:12:08 -08:00
Konstantin Shcheglov 4ee9ffccd0 Fix for an analysis driver test misprint.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2678173002 .
2017-02-06 13:21:46 -08:00
Leaf Petersen a3b4366f11 Infer Null for return type of functions with empty returns.
This allows inference to infer Null as the return type of functions
which have no return statements, or which return with no value.

Also allows inference to propagate Null.

Fixes https://github.com/dart-lang/sdk/issues/28602
Fixes https://github.com/dart-lang/sdk/issues/28630

BUG=
R=brianwilkerson@google.com, jmesserly@google.com

Review-Url: https://codereview.chromium.org/2667343005 .
2017-02-06 12:24:39 -08:00
Paul Berry dcddec9e7b Add a resynthesis test to verify summarization of generic closures.
See issue #25819.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2681453002 .
2017-02-06 09:03:15 -08:00
Leaf Petersen 15527f136f Temporarily restore ad hoc Future.then inference
BUG=
R=brianwilkerson@google.com, jmesserly@google.com

Review-Url: https://codereview.chromium.org/2676633005 .
2017-02-03 13:52:20 -08:00
Jennifer Messerly ac85576979 fix #28630, instance method tear-offs are treated as strict arrows
R=leafp@google.com

Review-Url: https://codereview.chromium.org/2675963004 .
2017-02-03 13:21:20 -08:00
Konstantin Shcheglov 2ca71e29ea Fix for 'The getter 'isDynamic' was called on null' because of dartbug.com/28515
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/28515

Review-Url: https://codereview.chromium.org/2676713002 .
2017-02-02 16:01:52 -08:00