Commit Graph

4276 Commits

Author SHA1 Message Date
Dan Rubel 54d131ebd9 merge fasta.PrecedenceInfo into analyzer.TokenType
* move precedence consts into analyzer token.dart
* move PrecedenceInfo.all to TokenType.all
* replace references to PrecedenceInfo with TokenType
* merge fasta.PrecedenceInfo into analyzer.TokenType

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

Review-Url: https://codereview.chromium.org/2837473002 .
2017-04-23 09:13:24 -04:00
Devon Carew d392382d10 Fix several typos.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2829963006 .
2017-04-22 11:15:03 -07:00
Konstantin Shcheglov d780f10d72 Remove ReferencedNames(Builder).
Nobody uses them anymore, so there is no point in computing it.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2835703002 .
2017-04-21 14:28:53 -07:00
Konstantin Shcheglov e24b9c218d Remove the limited invalidation feature.
So, we remove IncrementalCompilationUnitElementBuilder, which was one
of the places that potentially modifies element models.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2834773003 .
2017-04-21 12:09:28 -07:00
Konstantin Shcheglov bd76de48ca Pass FileSystemState into FileTracker.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2828163006 .
2017-04-21 10:53:31 -07:00
Konstantin Shcheglov c2dac3786d Restore ??= for the timer in file state.
The issue that forced us to use the explicit if-statement was fixed.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2833153002 .
2017-04-21 10:43:54 -07:00
Konstantin Shcheglov 6ad782027a Add support for external summaries bundle in AnalysisDriver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2829253002 .
2017-04-21 09:38:53 -07:00
Erik Corry 4b9bba55b4 Stoppp using trippple consonants
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2833073002 .
2017-04-21 17:50:13 +02:00
Paul Berry 77d26a330c Add top level type inference logic for integer literals.
This CL hooks up enough infrastructure for doing simple top level type
inference of variables whose initializer is an int.

Additional type inference rules will be added in follow-up CLs.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2828253003 .
2017-04-21 04:38:18 -07:00
Mike Fairhurst 7db51c7624 Remove two more implicit upcasts with angular/dart analysis drivers
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2830153002 .
2017-04-20 17:17:07 -07:00
P.Y. Laligand d7def1271d Scan all packages files found in the output directory to build package mappings. (#29400)
This accounts for the (common) situation where multiple targets (library, binaries, test) are declared inside a single Dart package.
2017-04-20 13:36:38 -07:00
Konstantin Shcheglov ce4d42e37e Include additional boolean flags into AnalysisOptionsImpl signature.
The failure to include 'enableAssertInitializer' could have caused
the problem in #29358. If we don't rebuild unlinked summaries for
packages, we might incorrectly handle asserts.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2828083004 .
2017-04-20 13:18:50 -07:00
Konstantin Shcheglov 8f2061e6e3 Issue 29393. Consider 'v ??= doSomething()' as usage of 'v'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/29393

Review-Url: https://codereview.chromium.org/2832013002 .
2017-04-20 12:43:21 -07:00
Konstantin Shcheglov ddf683c732 Issue 29398. Infer instance members using InheritanceManager of the ClassElement.
One of the other possible solutions is to put InheritanceManager
accessor into LibraryElement, just like LibraryElementInBuildUnit does.
But at the end I decided against it. Libraries are not immutable, we
still have vestiges of incremental analysis in the codebase.

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

Review-Url: https://codereview.chromium.org/2832893002 .
2017-04-20 12:03:50 -07:00
Vijay Menon 1112ad24cc Make conflicting summary check configurable
Not sure this is a great idea.  DDC will go awry if multiple copies of
the same type exist.  Can analysis or any other analyzer-based tool?

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

Review-Url: https://codereview.chromium.org/2829493002 .
2017-04-20 09:20:08 -07:00
Konstantin Shcheglov a73c8d0de1 MethodElementImpl.getReifiedType() should always create new parameter elements.
If we don't, and we transplant any of them into a new detached instance
of synthetic FunctionElementImpl, they are not able to access later
enclosingUnit in order to resynthesize their type.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2829843002 .
2017-04-19 16:36:34 -07:00
Mike Fairhurst 746fd35307 Now that contextRoot is within the is check, don't need contextRoot at all
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2828103002 .
2017-04-19 15:45:20 -07:00
Sigmund Cherem b57ca9fb55 Fix front-end tests: the original code is correct, this is a workaround for issue #29393
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2834533002 .
2017-04-19 15:37:03 -07:00
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
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
Mike Fairhurst 0aa8574a04 Fix failure using custom drivers with AnalysisDriverScheduler
Or alternatively, the AnalysisDriverGeneric interface could be extended?

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2815913006 .
2017-04-18 14:02:58 -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
Devon Carew 310d6d196b Fix an issue with restoring certain lint issues from summary files.
BUG=https://github.com/dart-lang/sdk/issues/29359
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2821943003 .
2017-04-18 08:50:22 -07:00
Konstantin Shcheglov f3fd6d5e44 Add the missing space before 'in'.
R=pquitslund@google.com, brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2824113002 .
2017-04-18 08:32:12 -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 62320cc838 Issue 25558. Report an error, but don't crash when AST it too deep.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25558

Review-Url: https://codereview.chromium.org/2823993002 .
2017-04-17 14:46:55 -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
Vijay Menon dcdccf4750 Revert "Report error if the same uri appears in multiple summaries."
This reverts commit 2afa21bb2c.

Breaking the bots.

TBR=jmesserly@google.com
BUG=

Review-Url: https://codereview.chromium.org/2821933002 .
2017-04-17 08:07:36 -07:00
Vijay Menon 2afa21bb2c Report error if the same uri appears in multiple summaries.
Fixes #27025

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

Review-Url: https://codereview.chromium.org/2781483007 .
2017-04-17 07:32:59 -07:00
Konstantin Shcheglov 2d0d000611 Flush on write in FileByteStore.
We see (rarely, but still) situations when FileState attempts to read
a *.unlinked file, but the file is empty. We think that this happens
when the user's machine crashes, so files are created, but not fully
written to disk.

This change has its cost - increase of FileByteStore.put() CPU usage
from 7% to 10% on Mac.

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

Review-Url: https://codereview.chromium.org/2821683002 .
2017-04-14 10:53:22 -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
Brian Wilkerson e30b56ccbe Fix another parser bug
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2808403005 .
2017-04-12 14:17:23 -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