Commit Graph

9676 Commits

Author SHA1 Message Date
Konstantin Shcheglov bd270935a5 Check bounds of type parameters of function type aliases.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1967583002 .
2016-05-10 10:49:25 -07:00
Konstantin Shcheglov 038478ea77 Implement 'instantiate to bounds' feature in resynthesizer.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1963593003 .
2016-05-10 09:58:06 -07:00
Konstantin Shcheglov e7b51f7bd1 Issue 26426. Don't use SDK summarie when analyzing SDK itself.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/26426

Review URL: https://codereview.chromium.org/1963023002 .
2016-05-10 09:54:24 -07:00
Konstantin Shcheglov 431e1b5e80 Issue 26427. Refine type of 'T + int' and 'T + double' when 'T extends num'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/26427

Review URL: https://codereview.chromium.org/1957953004 .
2016-05-10 09:50:58 -07:00
Johnni Winther b1f2c2cd3a Register NativeBehavior from WorldImpact.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1957343002 .
2016-05-10 09:50:11 +02:00
Johnni Winther 24c548f5bd Skip spurious constants in deferred computation.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1955403002 .
2016-05-10 09:41:19 +02:00
Brian Wilkerson a897fbc964 Mark the meta package as being strong mode clean
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1964663002 .
2016-05-09 13:49:33 -07:00
Brian Wilkerson 3bf8b18680 More strong mode clean-up in server
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1966453002 .
2016-05-09 13:24:56 -07:00
Paul Berry baa7dac310 Allow zero analyzer args in build mode.
This simplifies the integration with build systems such as Bazel, in
which it is sometimes convenient to have a build unit which depends on
other build units but doesn't introduce any additional source files of
its own.

R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1960263003 .
2016-05-09 12:39:06 -07:00
Paul Berry abd7a34476 Update dump_inferred_types to show an index of libraries and parts.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1962813002 .
2016-05-09 12:38:33 -07:00
Konstantin Shcheglov 522eaa9a80 Don't suggest types, getters, etc in 'for (Type ^)'.
Variable names should be suggested there.

It does not work for the moment, I'll need to make changes into
VariableNameContributor. But NOT suggesting all the garbage - for me
thi is 90% of the full solution ;-)

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1960783002 .
2016-05-09 12:30:15 -07:00
Brian Wilkerson 61818c95a1 Convert some for-in loops for performance
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1955373003 .
2016-05-09 11:01:16 -07:00
Johnni Winther 6e491cf152 Only call .hasResolvedAst in assertions.
R=sra@google.com

Review URL: https://codereview.chromium.org/1949713004 .
2016-05-09 10:34:01 +02:00
Johnni Winther a5078ea5f2 Serialize ParameterElement.node and ParameterElement.initializer for type inference
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1945263003 .
2016-05-09 10:23:34 +02:00
Paul Berry ba61fde1b1 Fix reference sharing in the event that import prefixes are used.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1961753002 .
2016-05-08 19:40:26 -07:00
Paul Berry 6725cece3c Fix AST-based type inference of enum types.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1957973002 .
2016-05-08 15:08:42 -07:00
Paul Berry 90dfbdd7d2 Fix AST summarization of synthetic function types and method tear-offs.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1960933002 .
2016-05-08 11:48:35 -07:00
Paul Berry f10f138cd1 Drop trailing dynamic when dumping inferred types.
This makes it easier to compare the output of AST-based and
element-based summaries, since element-based summaries cannot
distinguish between implicit type arguments and explicitly-specified
type arguments that happen to match the default (usually `dynamic`).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1957133002 .
2016-05-08 11:36:22 -07:00
Paul Berry c00b34b6f3 Fix InstanceFieldResolverVisitor to update element model.
R=leafp@google.com

Review URL: https://codereview.chromium.org/1956973002 .
2016-05-07 06:58:23 -07:00
Konstantin Shcheglov cf71ab114b Suggest 'is' in 'if (x is^)'.
So, we don't treat is as an expression start, and don't suggest
inappropriate 'while', 'await', etc or identifiers.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1958733002 .
2016-05-06 14:36:43 -07:00
Konstantin Shcheglov 3775d92000 Suggest 'var' and 'final' in intializer of 'for'.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1953893004 .
2016-05-06 13:49:48 -07:00
Paul Berry 839216141a Fix order of output of references with invokeMethodRef.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1955103003 .
2016-05-06 13:48:28 -07:00
Konstantin Shcheglov b73b82221e Fixes for completing 'for (var v in^)' and 'if (v is^)'.
The 'if (v is)' will require more work - we somehow manage to suggest
'if', 'final', 'switch', 'while', but NOT 'is'. But at least identifiers
are now out.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1956813004 .
2016-05-06 13:17:15 -07:00
Konstantin Shcheglov 4db64c34fe Keep all type arguments in summaries - dynamic or not.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1954203002 .
2016-05-06 12:13:03 -07:00
Paul Berry 45ea3a1938 Fix ast-based serialization of out-of-scope type parameters.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1956473004 .
2016-05-06 11:37:55 -07:00
Brian Wilkerson 8c244f03ad Report when members indirectly inherited through a mixin are not implemented (issue 26411)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1951363003 .
2016-05-06 11:29:44 -07:00
Paul Berry b992be5569 Fix a corner case of inferred types with function-typed parameters.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1950333003 .
2016-05-06 09:54:42 -07:00
Paul Berry 9dada87525 Fix summarization of inferred types which are function-typed params of typedefs.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1961533002 .
2016-05-06 09:30:06 -07:00
Konstantin Shcheglov 44e99952b3 Prepare for publishing analyzer 0.27.4-alpha.2
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1953933002 .
2016-05-05 15:22:26 -07:00
Konstantin Shcheglov 5082e6f8f2 Support for NamedExpression(s) as constructor initializer arguments.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1952663006 .
2016-05-05 15:13:20 -07:00
Konstantin Shcheglov 2460938b14 Issue 25914. Fix for compound assignments like 'T += T'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25914

Review URL: https://codereview.chromium.org/1948293003 .
2016-05-05 14:30:39 -07:00
Konstantin Shcheglov fef82ec1e8 Update mock SDK 'double'.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1956443003 .
2016-05-05 14:12:53 -07:00
Brian Wilkerson 451547ba27 Do not fail when an enum constant is annotated (issue 26413)
R=jwren@google.com

Review URL: https://codereview.chromium.org/1958433002 .
2016-05-05 13:31:18 -07:00
Konstantin Shcheglov a281a61d82 Replace 'allowTypeParameters' with 'numTypeArguments'.
With the final goal to get rid of it because we will move to providing
type arguments for all type parameters in order to implement the
'instantiate to bounds' feature.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1948123003 .
2016-05-05 10:52:40 -07:00
Konstantin Shcheglov 11b9691b51 Issue 25914. Refine type of 'T + T' when 'T extends num' to 'T' in strong mode.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25914

Review URL: https://codereview.chromium.org/1950983004 .
2016-05-05 10:11:39 -07:00
Paul Berry 5f3481e811 Skip local variables when dumping inferred types.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1956433002 .
2016-05-05 09:14:16 -07:00
Konstantin Shcheglov 597aaa15a4 Extract 'refineBinaryExpressionType' into TypeSystem.
This remove duplication and is also a preparation for fixing
https://github.com/dart-lang/sdk/issues/25914

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1953043002 .
2016-05-05 09:03:25 -07:00
Paul Berry 23323b27fc Add typedef support to summary linker.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1951173005 .
2016-05-05 07:43:47 -07:00
Konstantin Shcheglov ada9cf43db Issue 26355. Don't overwrite full index with declarations-only one.
What happens in this case is that when we analyze this project with
many (very small) files, we successfully index first declarations
(on computing RESOLVED_UNIT3) and then RESOLVED_UNIT. But when we attempt
to search, we ask for RESOLVED_UNIT, which is flushed. So, we compute it.
In the process we compute RESOLVED_UNIT3, and the listener in
_setupIndexInvalidation() indexes declarations, and overwrites the full
index.

There are several possible solutions, the simplest one is to not
overwrite any existing index information while indexing declarations.

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

Review URL: https://codereview.chromium.org/1946353004 .
2016-05-05 07:10:14 -07:00
Sigmund Cherem ed9826894a Do not evaluate on-demand to prevent breaking the deferred loading task
BUG= https://github.com/dart-lang/sdk/issues/26406
R=sra@google.com

Review URL: https://codereview.chromium.org/1950243002 .
2016-05-04 18:23:37 -07:00
Paul Berry fca48b75de Skip local functions when dumping inferred types.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1948103002 .
2016-05-04 11:29:38 -07:00
Konstantin Shcheglov 5e998d1e43 Resolve URIs of parts of imported libraries relative to importing library sources.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1952683002 .
2016-05-04 08:40:42 -07:00
Paul Berry 6a6d635027 Use property accessor elements for type inference rather than top level variable elements.
This makes the behavior of the linker more consistent with the
language spec.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1951833003 .
2016-05-04 08:02:51 -07:00
Brian Wilkerson 08241e9072 More strong mode clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1947813002 .
2016-05-04 07:42:46 -07:00
Johnni Winther 3f11e131ae Report UNMATCHED_TOKEN instead of EXTRANEOUS_MODIFIER
Closes #25308

R=ahe@google.com

Review URL: https://codereview.chromium.org/1943723003 .
2016-05-04 13:42:29 +02:00
Sigurd Meldgaard e47e8af364 Fix missing functionality with --allow-native-extensions
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1945183002 .
2016-05-04 10:53:15 +02:00
Paul Berry c6086791e8 Generalize ReferenceableElementForLink to work with explicit getters.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1946933002 .
2016-05-03 21:04:58 -07:00
Paul Berry db2e1df165 Fix a corner case of AST-based type inference with sequences of identifiers separated by '.'.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1949833002 .
2016-05-03 18:48:30 -07:00
Paul Berry e2c51a289d Implement PropertyAccessorElementForLink_Variable.getContainedName().
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1949783002 .
2016-05-03 15:19:10 -07:00
Konstantin Shcheglov d7f14a639d Turn on using SDK summaries in the command line analyzer.
We pass all of the shared tests now.
We used to pass too, but there was a couple small regressions.
The regressions have been fixed, so if you don't see a reason not to
turn using summaries on, I think we could do this.

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

Review URL: https://codereview.chromium.org/1945013002 .
2016-05-03 15:15:52 -07:00