Commit Graph

2689 Commits

Author SHA1 Message Date
Konstantin Shcheglov 7faf4bac93 Add FileSystemState.knownFilesSetChanges stream.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2826243002 .
2017-04-19 13:23:34 -07:00
Brian Wilkerson a3102bf441 Add support for reporting plugin data to instrumentation
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834453002 .
2017-04-19 11:01:24 -07:00
Konstantin Shcheglov 0ce4611fd9 Move 'general function type' unit tests into mixins to run them with Fasta.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2829693002 .
2017-04-19 10:11:21 -07:00
Jacob Richman 6ac3a24a2e Run formatter on the analyzer.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2826693004 .
2017-04-19 08:24:09 -07:00
P.Y. Laligand 043b8ebbf2 Fixed test failing on Windows. (#29380) 2017-04-18 12:50:50 -07:00
Konstantin Shcheglov 955d7cf037 Fix for instance fields inference when a setter has no parameter.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2828573002 .
2017-04-18 12:26:38 -07:00
Konstantin Shcheglov 19353f9e63 Issue 29358. Fix for reporting constant errors while evaluating constructor invocations.
We should not report errors in one file using offsets of node in
another file.

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

Review-Url: https://codereview.chromium.org/2825813002 .
2017-04-18 12:13:23 -07:00
P.Y. Laligand bfdf42a8e0 GN workspaces now use packages files. (#29364)
The previous version would use a global cache of package locations which would hide missing dependencies.
Also fixed an issue in file tracking with non-existing sources that resolvers such as PackageMapUriResolver sometimes return.
2017-04-18 10:41:29 -07:00
Konstantin Shcheglov 0adb817be2 Fix cast exception when a Handle gets a wrong element because of name conflict.
For example:

type 'TopLevelVariableElementImpl' is not a subtype of type 'FunctionTypeAliasElement' in type cast where
  TopLevelVariableElementImpl is from package:analyzer/src/dart/element/element.dart
  FunctionTypeAliasElement is from package:analyzer/dart/element/element.dart

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2824873002 .
2017-04-17 14:52:31 -07:00
Konstantin Shcheglov 63a6f83739 Issue 29360. Fix type name resolution for GenericTypeAliasElement.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/29360

Review-Url: https://codereview.chromium.org/2827463002 .
2017-04-17 10:16:28 -07:00
Vijay Menon a3d2e49198 Revert "Revert "Report error if the same uri appears in multiple summaries.""
Relanding after fixing package_bundle_reader_test.dart.

Note, original CL (already reviewed here: https://codereview.chromium.org/2781483007/) is patch set 1.

Test fix is patch set #2.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2825503002 .
2017-04-17 10:11:21 -07:00
Brian Wilkerson fcac30e080 Reland: Fix more parser bugs
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2812243006 .
2017-04-14 07:26:29 -07:00
Konstantin Shcheglov 95cfe76812 Add a flag for caching all analysis results in the driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2818623003 .
2017-04-13 19:17:48 -07:00
Alan Knight 7bf59fac63 Revert "Fix more parser bugs"
This reverts commit 65f8d25aa0.

BUG=

Review-Url: https://codereview.chromium.org/2821483003 .
2017-04-13 10:07:40 -07:00
Brian Wilkerson 65f8d25aa0 Fix more parser bugs
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2817873003 .
2017-04-13 09:26:31 -07:00
Brian Wilkerson b277f1023c Fix parser error
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2809213005 .
2017-04-13 06:14:05 -07:00
Konstantin Shcheglov 54f845cfd2 Support for generic function as type arguments in DeclarationResolver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2814223002 .
2017-04-12 13:47:23 -07:00
Brian Wilkerson 23f08ec04a Fix another parser issue with generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2814183002 .
2017-04-12 12:41:54 -07:00
Konstantin Shcheglov 5f28891e61 [Reapply] Pass ElementImpl as a context for resynthesizing types.
I added a couple of changes for link.dart to use context in getLinkedType().
I was not able to create a unit test for this case :-/

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2818543002 .
2017-04-12 11:54:23 -07:00
Brian Wilkerson e520fc2a45 More parser fixes for generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2817753002 .
2017-04-12 11:35:21 -07:00
Konstantin Shcheglov cb5bba03e2 Revert "Pass ElementImpl as a context for resynthesizing types."
This reverts commit d2a1bdff4a.

It causes an exception during pkg/analyzer analysis.

package:analyzer/src/fasta/mock_element.dart;package:analyzer/src/fasta/mock_element.dart;MockElement;accept
Unhandled exception:
NoSuchMethodError: Class 'CompilationUnitElementInDependency' has no instance getter 'typeParameterContext'.
Receiver: Instance of 'CompilationUnitElementInDependency'
Tried calling: typeParameterContext

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2814163002 .
2017-04-12 10:45:41 -07:00
Konstantin Shcheglov 7696ec5f31 Support for using generic function types in other AST structures.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2814063003 .
2017-04-12 10:12:30 -07:00
Brian Wilkerson dd150dd348 Correctly recognize non-constant enum children (issue 29306)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2815093002 .
2017-04-12 09:43:14 -07:00
Konstantin Shcheglov 2143087734 Build GenericFunctionTypeElementImpl in both ApiElementBuilder and LocalElementBuilder.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2809423003 .
2017-04-12 09:39:31 -07:00
Konstantin Shcheglov d2a1bdff4a Pass ElementImpl as a context for resynthesizing types.
We need to do this in order to associate resynthesized
GenericFunctionTypeElementImpl instances with these enclosing ElementImpl
instances. The same enclosing ElementImpl can also be used to get
the TypeParameterizedElementMixin for accessing type parameters.

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

Review-Url: https://codereview.chromium.org/2813543007 .
2017-04-12 09:35:56 -07:00
Brian Wilkerson 492eab84ec Fix parsing of generic function types as return types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2809773005 .
2017-04-12 07:27:39 -07:00
Brian Wilkerson 3dcf0e31c5 Split error code to ease future improvements
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2813553006 .
2017-04-11 13:35:38 -07:00
Konstantin Shcheglov 6fe8e2278b Simplify PackageMapUriResolver - one folder, return any file, or null.
If the package is know, we return the corresponding file, whether it
exists or not.

If the package is not know, there is no valid Source to resolve to,
so we return null.

We don't need all the features that existed.

Internally we switched to BazelPackageUriResolver, which has its own
logica for searching files in workspaces across multiple folders.

All the places where we create PackageMapUriResolver in analyzer
or analysis_server, we create it with exactly one folder.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2812093002 .
2017-04-11 13:03:56 -07:00
Brian Wilkerson 0c8b5b8232 Fix a warning
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2817493002 .
2017-04-11 12:08:26 -07:00
Konstantin Shcheglov 38e8b1509e Issue 29109. Resynthesize PrefixElement(s) to fix constants evaluation.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/29109

Review-Url: https://codereview.chromium.org/2815713003 .
2017-04-11 11:28:03 -07:00
Konstantin Shcheglov 3dd42456e4 Prioritize analysis of files that import the changed file, or have an error or warning.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2808173002 .
2017-04-11 08:26:26 -07:00
Konstantin Shcheglov f0ae30dca5 Fix for summarization of generic function type aliases and support for resynthesizing.
This is based on your CL https://codereview.chromium.org/2808093004/ and
includes fixes for summarization and resynthesis.

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

Review-Url: https://codereview.chromium.org/2814443005 .
2017-04-11 07:07:16 -07:00
Konstantin Shcheglov 021d99e05d Issue 29288. Resynthesize Import/Export/PartElement for every directive.
We need all of them because there might be associated annotations,
which should be applied to corresponding AST nodes.

https://github.com/dart-lang/sdk/issues/29288
https://github.com/dart-lang/sdk/issues/29188

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

Review-Url: https://codereview.chromium.org/2809523002 .
2017-04-09 10:12:43 -07:00
Vijay Menon bc3089838c Reify implicit casts for FutureOr
Before landing, two issues to resolve:
(1) We appear to allow sideways casts now without static error - e.g.,

List<Object> -> FutureOr<List<String>>

Is that intended?  If so, it breaks an assumption that implicit casts
are from supertype to subtype.

(2) LUB and FutureOr

It appears that the LUB of, e.g., String and Future<String> is Object.
See fixes in tests to record casts back to FutureOr.

Fixes #29251

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2801683004 .
2017-04-07 17:33:34 -07:00
Konstantin Shcheglov 07347d84fc Parse type substitution comments /*=T*/ in variable declarations with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2804753003 .
2017-04-07 12:59:02 -07:00
Konstantin Shcheglov ee89054fe9 Issue 29288. When infer new FunctionType, makes its FunctionElement own its ParameterElement(s).
Never share.

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

Review-Url: https://codereview.chromium.org/2799093007 .
2017-04-07 12:21:53 -07:00
Brian Wilkerson 1910147425 Partial fix for generic function types - non-driver case
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2802203003 .
2017-04-07 11:17:37 -07:00
Konstantin Shcheglov 80a935bd76 Fix for parsing named factory constructors with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2803113002 .
2017-04-06 14:11:57 -07:00
Konstantin Shcheglov 8c8a02ab4f Support for parsing native function bodies with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2797343003 .
2017-04-06 14:00:44 -07:00
Konstantin Shcheglov 1b0b94c6e6 Fix for parsing annotations before variables in for-loop with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2797303003 .
2017-04-06 10:59:53 -07:00
Konstantin Shcheglov c9407b4544 Include ':' before constructor separators into AST with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2802753002 .
2017-04-05 13:25:46 -07:00
Adam Barth c25cd4da33 Restrict @immutable checks to instance fields
R=brianwilkerson@google.com, pquitslund@google.com

Review-Url: https://codereview.chromium.org/2805443002 .
2017-04-05 10:50:41 -07:00
Brian Wilkerson c2f599473b Fix generic function types in variable declarations (issue 29237)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2798663003 .
2017-04-05 06:24:25 -07:00
Konstantin Shcheglov 03a0ee0943 Include 'invokeMethodRef' reference as a linking dependency.
It was crashing with StackOverflow internally. With changes since the
latest internal release it was not crashing, but still failing with
assertion. This makes it fail with a correct error, without throwing
an exception.

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

Review-Url: https://codereview.chromium.org/2802473002 .
2017-04-04 14:35:52 -07:00
Konstantin Shcheglov 16e9641583 Build elements for FieldFormalParameter(s) even for local functions.
This is invalid code, we report an error, but we cannot leave it as
null, because this causes exceptions down the stream.

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

Review-Url: https://codereview.chromium.org/2800443002 .
2017-04-04 12:45:11 -07:00
Konstantin Shcheglov a5d8f67ea5 Move tests for parseVariableDeclarationList(), fix for keywords.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2796123002 .
2017-04-04 12:41:41 -07:00
Konstantin Shcheglov 83f6ef67a8 Fix for resynthesis when a part URI is empty.
This is about 20% of all internal exceptions.

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

Review-Url: https://codereview.chromium.org/2789113005 .
2017-04-04 12:31:49 -07:00
Peter von der Ahé 5fcbc900a6 Prepare for separate setter scope.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2788913002 .
2017-04-04 12:20:16 +02:00
Peter von der Ahé babf66241f Move scope.dart.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2794533002 .
2017-04-04 11:00:43 +02:00
Peter von der Ahé d8304e0c5e Remove unused methods from CL 2793113002.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2795983002 .
2017-04-04 10:38:26 +02:00