Commit Graph

1740 Commits

Author SHA1 Message Date
Konstantin Shcheglov 4e8e1e2e04 Improve search for constructors and import elements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1778363003 .
2016-03-10 14:57:42 -08:00
Konstantin Shcheglov 5271cd3259 Fix for indexing synthetic elements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1779233002 .
2016-03-10 10:57:08 -08:00
Brian Wilkerson f42380ccbb Improve the error message when there is an infinite loop in tasks
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1783853002 .
2016-03-10 09:04:26 -08:00
Brian Wilkerson 1a455bcb9d Move element handles out of generated
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1780883002 .
2016-03-10 07:40:33 -08:00
Bob Nystrom 8defa5f77c Split resolver_test.dart into smaller files.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1782463002 .
2016-03-09 10:42:09 -08:00
pq 402f27e26d Fix enableConditionalDirectives option handling.
Net-net: we weren't copying this value over when copying context options.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1774213003 .
2016-03-09 10:01:28 -08:00
Konstantin Shcheglov 3af20476d1 Add AnalysisContext.onResultInvalidated(descriptor).
This method will be used to remove index entries corresponding to
invalidated resolved units.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1776023002 .
2016-03-08 12:55:06 -08:00
Konstantin Shcheglov 15bfead120 Sort strings in the index.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1774253002 .
2016-03-08 12:45:29 -08:00
Bob Nystrom cb7aa02116 Type check for-in statements.
This does nominal checking on the iterable expression used in a for-in
statement:

1. It must implement Iterable.
2. The type argument to Iterable must be assignable to the variable's
   type.

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

Review URL: https://codereview.chromium.org/1771153002 .
2016-03-08 11:25:49 -08:00
Brian Wilkerson d8786ac278 Change when enum constant elements are created to fix bug in re-creating ASTs from existing element models
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1771243002 .
2016-03-08 08:45:44 -08:00
pq 24ac0d4e2d Fix cycle in override check.
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1769253002 .
2016-03-07 14:09:58 -08:00
pq 4528052e98 Validation of @mustCallSuper overrides.
Carried over and refined from https://codereview.chromium.org/1767843002/.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1773803002 .
2016-03-07 13:37:35 -08:00
Konstantin Shcheglov f2111c2497 Search for direct and indirect subclasses.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1770083002 .
2016-03-07 11:30:44 -08:00
Konstantin Shcheglov 5f62cca534 Record IS_ANCESTOR_OF relations.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1772823002 .
2016-03-07 11:00:49 -08:00
Leaf Petersen 6a9af860d0 Fix method inference crasher.
During class member inference, only instantiate the type formals of
an overridden method when there are type formals to instantiate.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1763013003 .
2016-03-07 10:49:57 -08:00
Brian Wilkerson 508492d048 Fixes to associating existing elements with an AST
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1768713002 .
2016-03-07 10:36:36 -08:00
Florian Loitsch dd326beee1 Move more messages.
Migrates some of the 'undefined' messages to the shared file.

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

Review URL: https://codereview.chromium.org/1750143005 .
2016-03-07 16:39:12 +01:00
Florian Loitsch 65b4256b9e Support multiple categories per message.
Also move more messages to use this feature.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1763373002 .
2016-03-07 16:37:57 +01:00
Konstantin Shcheglov ec906bf12b Implement search for local elements.
We don't use Index for them, instead of visit coresponding AST subtrees
and add SearchMatch(es).

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1760243004 .
2016-03-05 07:50:11 -08:00
Konstantin Shcheglov 822fa6c912 Update codeOffset/codeLength during incremental resolution.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1768613002 .
2016-03-04 11:36:35 -08:00
Konstantin Shcheglov 40ebbcfb7c Don't index constructor element reference second time.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1761073004 .
2016-03-04 10:43:18 -08:00
John Messerly 764a067813 Fixes list/map literal to not infer bottom
R=leafp@google.com

Review URL: https://codereview.chromium.org/1759363002 .
2016-03-04 09:43:13 -08:00
Konstantin Shcheglov 9c79752839 Resynthesize codeOffset/codeLength properties.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1762193002 .
2016-03-04 09:26:31 -08:00
Paul Berry c46f593b33 Add support for ConstructorElementImpl.isCycleFree to summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1762663002 .
2016-03-03 11:00:27 -08:00
Konstantin Shcheglov 80531d974d Make SearchMatch usable for the new index - remove the element field.
The 'element' is still accessible, but as a computed property.

In many cases we don't need to know the containing element, and need
only the unit source, or the LibraryElement. So, by computing it on
demand we may save some time and make SearchMatch usable with the
new index - where we don't know the Element.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1764553002 .
2016-03-03 08:40:57 -08:00
Konstantin Shcheglov 3fe1282f75 Don't use List caches for lists of primitive values.
Caching is useful for lists of objects, but lists of primitive values
it is wasteful to create copies when we can read directly from the
underlaying buffer.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1760523008 .
2016-03-03 08:04:52 -08:00
Kevin Moore 0ed4df8155 import cleanup
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1759483004 .
2016-03-02 17:10:01 -08:00
Leaf Petersen 7d2976c7d5 Add instantiate method on ParameterizedType and InterfaceType,
and deprecate the old substitute4 in favor of instantiate.

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

Review URL: https://codereview.chromium.org/1758913002 .
2016-03-02 15:06:38 -08:00
Leaf Petersen ce806bf307 Instantiate interface types to bounds.
Refactors some common code into TypeSystem, and makes strong mode
interface types instantiate to bounds when no type arguments are
passed.

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

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1756673002 .
2016-03-02 13:18:15 -08:00
Paul Berry 457df30acf Fix handling of task model circularities.
When a circularity is found during task model evaluation, we need to
continue evaluating task inputs (skipping the inputs that contribute
to the circularity) in order to find the largest possible strongly
connected component that contributes to the circularity.  Previously,
the skipping logic was implemented by comparing WorkItem.target and
WorkItem.spawningResult.  However, since WorkItems are equality
compared using WorkItem.target and WorkItem.descriptor, it was
possible that a WorkItem might not have been skipped when it should
be.

This CL updates the skipping logic so that it uses WorkItem.target and
WorkItem.descriptor to decide which WorkItems to skip.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1748933005 .
2016-03-02 12:27:32 -08:00
Brian Wilkerson 06774c315f Remove invalid URI in an attempt to fix a windows bug.
Review URL: https://codereview.chromium.org/1750773002 .
2016-03-02 08:31:21 -08:00
Konstantin Shcheglov 089e1ba737 Add codeOffset/codeLength properties to ElementImpl.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1753963003 .
2016-03-01 21:04:17 -08:00
John Messerly 02f888711c fix ResolutionCopier to copy staticInvokeType/propagatedInvokeType
(these will be needed for DDC generic methods)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1754873002 .
2016-03-01 17:30:09 -08:00
John Messerly 1226c387b7 fix ResolutionCopier.visitAdjacentStrings
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1749423002 .
2016-03-01 17:28:16 -08:00
pq 9ea17184ad Add @overrides to (a lot of) analyzer.
This gets us roughly half+ way there.  We should defintely consider automating this to speed up the rest.  (Even with the quick-fix it's VERY tedious and slow going.)

Once we've done this in bulk, I'd like to add the  `annotate_overrides` lint to analyzer and server `.analysis_options`.

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

Review URL: https://codereview.chromium.org/1749143003 .
2016-03-01 16:33:20 -08:00
Paul Berry ff6a744f38 Implement forwards compatibility for summary enums.
If an attempt is made to read an unrecognized enum value, then rather
than crashing, we will read the default (first) value of the enum type.

This facilitates forwards compatibility by ensuring that if a new enum
value is added in the future, older code will still be able to read the
resulting summary files without crashing.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1747413002 .
2016-03-01 13:28:10 -08:00
Paul Berry 92176ad482 Add major and minor version numbers to summary files.
Note: my expectation is that we won't start bumping the version
numbers until summaries begin being used in the wild.  While summary
support remains experimental, the version number will remain at 1.0.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1754793002 .
2016-03-01 12:21:40 -08:00
Paul Berry 5772408ed0 Clear static ElementFactory state at the start of all resolver tests.
This prevents the ElementFactory's ClassElement for `Object` (which it
stores statically) from getting accidentally shared between separate
unit tests in a single test run, which could cause state to leak
between the tests.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1752023002 .
2016-03-01 11:26:39 -08:00
Konstantin Shcheglov 7d0fbd1b11 Separate 'isQualified' flags as List<bool>.
It turned out that for used names we don't need any flags because we
want to store only qualified unresolved (potential) class member
usages. So, no flags for used names at all, at least for now.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1750163003 .
2016-03-01 11:06:40 -08:00
Brian Wilkerson 76d22fe363 Move DelegatingAstVisitor into the public API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1747093002 .
2016-03-01 07:57:01 -08:00
Konstantin Shcheglov 4ca8d2d4a8 Support for boolean lists in FlatBuffer.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1747663002 .
2016-02-29 18:08:43 -08:00
Konstantin Shcheglov 46aa21ac6c Remove indexing debug code.
The bots are green, it seems that unwrapping Member(s) fixed the problem.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1751613002 .
2016-02-29 17:50:36 -08:00
Konstantin Shcheglov 93e9a3c9a1 Record only qualified unresolved name usages.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1755433002 .
2016-02-29 17:46:47 -08:00
Brian Slesinsky 09a7387740 Clear stale elements in an unresolved TypeName
BUG=https://github.com/dart-lang/sdk/issues/25855
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1745413002 .
2016-02-29 17:16:28 -08:00
Konstantin Shcheglov 3a401c3d59 Follow ClassTypeAlias constructor redirections.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1746963002 .
2016-02-29 14:13:30 -08:00
Konstantin Shcheglov 2d94021a68 Record names references in index.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1753433002 .
2016-02-29 13:16:59 -08:00
Konstantin Shcheglov b982e02a60 Attempt to fix build: unwrap Member(s).
TBR

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1748053002 .
2016-02-29 11:18:13 -08:00
Konstantin Shcheglov db2fd1ef1e Rename some index fields and use single 'UnitIndex.unit' field.
The added prefix 'usedElement' groups fields in UnitIndex.
In a next CL I will add also 'usedName' field set for indexing used
names, resolved and unresolved.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1746113002 .
2016-02-29 10:50:19 -08:00
Konstantin Shcheglov 10734b2c4a Add ElementInfo.id check fr null to debug flakiness on bots.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1751453002 .
2016-02-29 10:19:27 -08:00
Brian Slesinsky 44301b8001 Clear the element for imports and exports when the target doesn't exist.
This fixes a bug where the unused import hint doesn't go away after
removing the file being imported.

(Also, I suspect it fixes a memory leak.)

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1743523003 .
2016-02-29 10:06:10 -08:00