Commit graph

4138 commits

Author SHA1 Message Date
Brian Wilkerson e28064f405 Restore partial analysis of analysis options files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2946313003 .
2017-06-22 08:00:50 -07:00
danrubel ebdc0eda11 add Parser.withoutFasta constructor
This renames an existing private Parser constructor as a short term fix
so that the angular plugin can extend the Parser.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2952113002 .
2017-06-22 09:41:46 -04:00
Paul Berry 95aaba5085 In strong mode, properly infer the return types of setters as void
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2952873002 .
2017-06-21 14:51:40 -07:00
Paul Berry b2c4b0ac0a Implement override-based type inference for instance methods.
Also, fix a rare infinite loop bug in analyzer exposed by one of the
tests.

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

Review-Url: https://codereview.chromium.org/2946273002 .
2017-06-21 13:56:04 -07:00
Dan Rubel d0910ce078 translate fasta parser error to analyzer error
* translate fasta parser BuiltInIdentifierAsType error to analyzer error
* remove unused error listener field

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2944383002 .
2017-06-20 13:18:48 -04:00
Dan Rubel 966d1a4701 integrating fasta parser
* start integrating fasta parser into analyzer
* extract new Scanner.fasta factory

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2948473002 .
2017-06-20 12:24:13 -04:00
Brian Wilkerson 24996fbfe7 Add support to pass the location of the analysis options file to plugins
R=mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2947743002 .
2017-06-20 07:41:03 -07:00
Paul Berry e8131d6f1a Fix ParameterElementImpl.hasImplicitType for function-typed parameters.
UnlinkedParam.type serves a dual role: for ordinary parameters it is
the declared type; for function-typed parameters it is the declared
return type.  So to determine whether a parameter has an implicit type
it is not sufficient to check whether UnlinkedParam.type is `null`.
We also need to check whether the parameter is function-typed.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2947703002 .
2017-06-19 13:13:53 -07:00
Paul Berry 7939ea00ef Implement type inference of getters/setters based on inheritance.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2943273002 .
2017-06-18 16:35:02 -07:00
Paul Berry ba14751f55 Implement override-based inference of instance fields.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2938423003 .
2017-06-17 06:27:27 -07:00
Konstantin Shcheglov bf5ea8f593 Using identical(xxx, typeProvider.yyy) is not compatible with Analysis Driver.
This fixes 8 out of 22 failing tests for DDC using Analysis Driver.

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

Review-Url: https://codereview.chromium.org/2947443002 .
2017-06-16 13:38:33 -07:00
Jens Johansen 68bb955b7f Fix bot failure because of missed update of AssertStatement
BUG=

Review-Url: https://codereview.chromium.org/2943103002 .
2017-06-16 13:28:49 +02:00
Dan Rubel b03ff5c772 update analyzer tests for fasta scanner
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2940783002 .
2017-06-14 11:17:31 -04:00
Dan Rubel 305f358fa4 update statement completion for fasta scanner
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2936143002 .
2017-06-14 11:15:50 -04:00
Paul Berry 92a878f276 Fix argument names for handleIndexedExpression.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2935833002 .
2017-06-14 06:05:53 -07:00
Peter von der Ahé 6302a5b31b Implement metadata on classes and additional semantic checks.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2938793002 .
2017-06-14 14:59:53 +02:00
Peter von der Ahé 3c17c44d52 Implement metadata on methods and fields.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2935993002 .
2017-06-14 08:25:17 +02:00
Paul Berry 211e578273 Chase imports in analyzer's front_end_inference_test.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2936043002 .
2017-06-13 14:27:54 -07:00
Paul Berry a1ecb46a4c Fix top level type inference for binary operators.
Multiple changes were required:

- The analyzer's mock SDK had an incorrect return type for
  `num.operator/`.

- We weren't considering the RHS of the binary operators `+`, `-`,
  `*`, and `%` to be an inference dependency (we need to, since the
  special overload rules for int depend on the type of the RHS).

- We weren't executing the overload logic when doing top level type
  inference.

- The logic for deciding what operators are overloaded was incorrect.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2940703002 .
2017-06-13 13:07:00 -07:00
Peter von der Ahé db2e915aac Improve recovery from compile-time errors.
R=danrubel@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2938573002 .
2017-06-13 16:00:15 +02:00
Devon Carew 32071cffc3 Remove an unused local variable.
BUG=

Review-Url: https://codereview.chromium.org/2933103002 .
2017-06-12 07:48:35 -07:00
Brian Wilkerson 62d0376231 Run the sorter to reduce code churn
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933753002 .
2017-06-12 07:37:14 -07:00
Brian Wilkerson b928683560 Add a couple of lints to the options files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2933713002 .
2017-06-11 09:12:48 -07:00
Peter von der Ahé 4e8203f9cd Improve error messages and recovery.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2924363002 .
2017-06-10 10:43:03 +02:00
Paul Berry 6b65fc22f7 Annotate targets of implicit this property gets/sets in inference tests.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933663002 .
2017-06-09 17:41:13 -07:00
Konstantin Shcheglov 90f12aa802 Fix for resynthesizing generic functions during linking.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2931123002 .
2017-06-09 14:21:02 -07:00
Florian Loitsch 377093841f Report an error when a part-of refers to an unnamed library.
Fixes #28522
BUG= http://dartbug.com/28522
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2931893004 .
2017-06-09 21:08:26 +02:00
Brian Wilkerson 1a0fa7f211 Copy type information for generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928173002 .
2017-06-09 10:33:24 -07:00
Alexandre Ardhuin 617d0f53b6 add hint for @required (#29828) 2017-06-09 06:36:50 -07:00
Dan Rubel 56402976cd more fixes for fasta analyzer integration
* fix scanner adapter setSourceStart
* fix fasta token copy() methods
* replace "is TokenWithComment" with "?.preceedingComments != null"
* update scanner test

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2928773003 .
2017-06-08 18:02:09 -04:00
Konstantin Shcheglov 5fe793ec4e Use ClassHierarchy.applyChanges() in MixinFullResolution.
So, we let the hierarchy to decide how to react to the changes, and
instance of which class hierarchy to create.

This makes initial compilation with Kernel Driver about 5% faster.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2924333002 .
2017-06-08 14:00:51 -07:00
danrubel c54372bdc5 fix test
Review-Url: https://codereview.chromium.org/2929673004 .
2017-06-08 12:58:05 -04:00
danrubel d675a7c375 update errorCodeValues
Add the new fasta Scanner error codes to the errorCodeValues list
and add a test to ensure that any new error codes will also be added.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2932483002 .
2017-06-08 12:35:53 -04:00
Paul Berry 029771d746 Add type inference for complex assignments whose LHS is an index expression.
In later CLs I will expand on this code to handle other kinds of
complex assignments.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2926763003 .
2017-06-08 09:25:24 -07:00
Peter von der Ahé 001ac97389 Implement initializer asserts.
Closes https://github.com/dart-lang/sdk/issues/29762

R=kasperl@google.com

Review-Url: https://codereview.chromium.org/2930673002 .
2017-06-08 13:46:26 +02:00
Devon Carew 79c2668d2b add memory usage to the diagnostics page
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2927783002 .
2017-06-07 11:28:34 -07:00
Dan Rubel b0374f214c update analyzer parser tests for fasta scanner
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2930453002 .
2017-06-07 11:05:44 -04:00
Paul Berry b18c325f68 Add int.toString() to analyzer mock SDK.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2922383003 .
2017-06-06 13:35:36 -07:00
Paul Berry 49110ba0d6 Fix implementation of fold() in analyzer's mock SDK.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2924853003 .
2017-06-06 13:23:45 -07:00
Paul Berry f7f9d1766f Fix corner cases of type inference with implicit references to .call.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928613003 .
2017-06-06 13:00:26 -07:00
Paul Berry 32e78868bd Record method invocation targets that are not procedures.
We don't yet store the targets in the kernel representation, since
kernel currently requires method invocation targets to be procedures
(see https://codereview.chromium.org/2923653003/).  But we record the
target that we *would* store in the kernel to instrumentation so that
we can pass tests.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2920223008 .
2017-06-06 12:27:34 -07:00
Peter von der Ahé 7df768af0d Restore invariant that stack is empty in parseFunctionBody.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2914373002 .
2017-06-06 16:58:31 +02:00
Konstantin Shcheglov 0a194c2f40 Named parameters of generic functions should have names.
I stumbled upon this problem accidentally while editing a file.
It caused an exception in summarizer.

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

Review-Url: https://codereview.chromium.org/2918373002 .
2017-06-05 13:35:35 -07:00
Konstantin Shcheglov c61167ab1d Support for implicitFunctionTypeIndices in CompilationUnitElementForLink.resolveTypeRef().
https://github.com/dart-lang/sdk/issues/29759
https://github.com/dart-lang/sdk/issues/29533

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2925663002 .
2017-06-05 13:28:55 -07:00
Paul Berry b5883633f7 Do not annotate type parameters of instantiated function types.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2925693002 .
2017-06-05 13:26:12 -07:00
Paul Berry 2513c2b93f Adjust expectations for parameterized closures to match front_end behavior.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2925583003 .
2017-06-05 12:51:37 -07:00
Paul Berry 2162b2da9b Improve annotation of type variables in type inference tests.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2918373003 .
2017-06-05 11:47:07 -07:00
Devon Carew 24b112d865 Remove an analysis server import.
BUG=
R=brianwilkerson@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2920333002 .
2017-06-05 11:22:53 -07:00
Brian Wilkerson e8a5e404c3 Move LocalDeclarationVisitor for use by contributors that will be moved to analyzer_plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2918343002 .
2017-06-05 10:24:54 -07:00
Devon Carew 0b79e4d20d update the analyzer and analysis server perf tags
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2917183003 .
2017-06-03 19:51:27 -07:00