Commit Graph

8489 Commits

Author SHA1 Message Date
Paul Berry 4c28eb6f67 Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-08 10:16:29 -08:00
John Messerly 5e11857451 Refactor strong mode to remove duplicate TypeRules
Most of this code is already in StrongTypeSystemImpl. A few helpers move there, with some moving into CodeChecker. This does not rename "rules" parameters/variables yet, but let me know if we should do that.

This just moves code around. One subtle thing: TypeRules.isAssignableTo was only used in one place, in override checking, and that method just forwarded to TypeRules.isSubTypeOf. By contrast, StrongTypeSystemImpl does *not* just forward. So OverrideChecker now uses isSubtypeOf, preserving its old behavior.

R=leafp@google.com

Review URL: https://codereview.chromium.org/1507933002 .
2015-12-07 17:19:13 -08:00
pq 1e4cea355f Embedded option processing fixes (#25115).
* Updates error filter and linter configuration to play nice with embedded options.
  * Fixes embedded lint config (#25115).
* Improves support for (and tests of) options file deletions.
* Pulls in linter with untyped options support (needed for processing merged options).

Unblocks: https://github.com/flutter/flutter/issues/624.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1503353002 .
2015-12-07 16:18:47 -08:00
Leaf Petersen 67306ae655 Handle property accesses in generic method invocation
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1506003002 .
2015-12-07 16:01:02 -08:00
Konstantin Shcheglov dad4baa782 Issue 25108. Add ExecutableElement(s) into the 'invalid override' messages.
It uses the fact that ExecutableElement.toString() produces the full signature, with types and parameter names.

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

Review URL: https://codereview.chromium.org/1509693002 .
2015-12-07 13:58:55 -08:00
Brian Wilkerson c5f82b8376 Additional clean-up after moving to the new task model; a breaking change needed to allow a bug to be fixed
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1503203002 .
2015-12-07 12:02:42 -08:00
pq 032c829246 ErrorCode hashing for faster lookup in validation.
* Stores error codes in a laziliy initialized `HashSet` for speedy lookup.

(Follow-up to John's comment here: https://codereview.chromium.org/1501633003/)

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1505623002 .
2015-12-07 11:30:30 -08:00
pq ee310b6aff Options processing API update (#25126).
Updates processing API to accept untyped options maps.

Required to support processing options merged from embedders and local analysis options.

See: https://github.com/dart-lang/sdk/issues/25126

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1506963002 .
2015-12-07 11:27:17 -08:00
Brian Wilkerson ea3ba0e31f Remove deprecated code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1502213002 .
2015-12-07 10:24:36 -08:00
Brian Wilkerson 1101a1e0e7 Add more (incomplete) diagnostic support to the status pages
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1503893002 .
2015-12-07 09:50:37 -08:00
John Messerly 095310bb36 Allow explicitly passing generic function type args
Also supports implicit dynamic correctly and ensures we have a sensible element, which fixes #25100

R=leafp@google.com

Review URL: https://codereview.chromium.org/1504483002 .
2015-12-07 09:46:38 -08:00
Paul Berry de3a1b22c8 Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-07 07:04:07 -08:00
pq 109ccdaf97 Strong-mode error code validation "enum" (#25117).
Adds an enum of valid strong-mode error code names a la `ErrorCode.values`.

This gets used in error code validation when processing `.analysis_options`.

See: https://github.com/dart-lang/sdk/issues/25117

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1501633003 .
2015-12-06 09:10:12 -08:00
Paul Berry 4f654473ff Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-06 08:41:24 -08:00
pq b4fd7532ff Comment cleanup.
Follow-up from: https://codereview.chromium.org/1497253002/

BUG=
R=leafp@google.com

Review URL: https://codereview.chromium.org/1501573004 .
2015-12-04 16:34:49 -08:00
Bob Nystrom af4d7319fe Remove show clauses for types that moved to other libraries.
ConstantEvaluationTarget is now imported from dart.dart and
AnalysisException is in java_engine.dart.

Review URL: https://codereview.chromium.org/1501803002 .
2015-12-04 15:50:30 -08:00
pq eacbee4616 Align strong-mode error codes with analyzer conv.
This canonicalization will allow suppression by code name to "just work" unblocking https://github.com/flutter/flutter/issues/624.

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

Review URL: https://codereview.chromium.org/1497253002 .
2015-12-04 15:49:22 -08:00
Leaf Petersen 7f43d10eeb Allow return of Future in async function.
Fixes dart-lang/dev_compiler#316
Fixes #24540
Fixes flutter/flutter#607
Fixes #25042

BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1495263003 .
2015-12-04 15:33:28 -08:00
Leaf Petersen 26bc5d6b2d Downwards inference on non-generic constructor parameters (fixes #25106)
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1499813002 .
2015-12-04 10:26:26 -08:00
Paul Berry cd03a05caf Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-04 09:06:41 -08:00
John Messerly 6cababc94c Fixes incorrect generic function type capture
This improves how generic function types are modeled. In particular, we can now handle types like <T>T -> T, in printing, equality, and the type parameter is correctly removed when it is instantiated.

This preserves the existing lazy "substitute" operation, and makes the "instantiate" operation interact with it correctly. Given a type like:

    {T/T}<S>T -> S

we can substitute S/T to get:

    {S/T}<S>T -> S

then if we instantiate as <int> we'll get the correct:

    {S/T, int/S}T -> S, which == S -> int

This also converts typedefs over to the new system, as this seemed like the most natural thing. (However this does *not* change how the type name is evaluated, in particular given the type name "F", where "F" is a typedef `<T>T -> T`, will result in the function type `{dynamic/T}T->T` exactly as it did before. If we want to write the type `<T>T->T` we will need a different mechanism.)

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

Review URL: https://codereview.chromium.org/1488383004 .
2015-12-03 15:03:03 -08:00
Paul Berry 7d3c4743db Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-03 14:22:24 -08:00
Brian Wilkerson 18f5782620 Fix warnings
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1496873004 .
2015-12-03 14:07:09 -08:00
Leaf Petersen f5b28b7cf3 Checker is defensive against unresolved redirecting constructor
Fixes #25071

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1500793002 .
2015-12-03 13:42:52 -08:00
Leaf Petersen 2d61ed26b7 Check for void in rules subtyping (fixes #25069)
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1497803003 .
2015-12-03 13:41:28 -08:00
Konstantin Shcheglov 072aaaefb6 Issue 25101. Flush TOKEN_STREAM after computing PARSED_UNIT.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25101

Review URL: https://codereview.chromium.org/1495783005 .
2015-12-03 12:52:58 -08:00
Brian Wilkerson b9644af695 Remove the old task model
Review URL: https://codereview.chromium.org/1490233007 .
2015-12-03 10:14:06 -08:00
Konstantin Shcheglov dc13ac659f Fix for DeclarationResolver and invalid getters/setters.
This fixes the following exception:

Caused by The null object does not have a getter 'variable'.

NoSuchMethodError: method not found: 'variable'
Receiver: null
Arguments: []

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1492373002 .
2015-12-03 09:59:00 -08:00
Leaf Petersen e155b03b26 Fix JS inline regression. We were exiting early instead of moving on to look for JS calls.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1497673002 .
2015-12-03 09:57:57 -08:00
Leaf Petersen 500efa1e7d Fix some inference corner case crashes. Running the DDC language tests against the bleeding edge analyzer exposed a few small issues, this fixes the crashers.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1499533002 .
2015-12-02 21:43:06 -08:00
Brian Wilkerson 600fc17de1 Clean-up the registration of plugins
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1487953002 .
2015-12-02 13:25:28 -08:00
Leaf Petersen daf5f6d258 Hide inference hints. Fixes #24563.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1498573002 .
2015-12-02 13:07:46 -08:00
Paul Berry 5528327504 Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-02 11:45:10 -08:00
Konstantin Shcheglov f12da4d00c Issue 25050. Fix for NPE in ConstantEvaluationEngine when duplicate fields.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25050

Review URL: https://codereview.chromium.org/1493833003 .
2015-12-02 11:29:36 -08:00
Brian Wilkerson 4e3a1a468a Lexical support for configurable imports (DEP 40)
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1406253004 .
2015-12-02 11:20:07 -08:00
Paul Berry a8acaa48db Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-02 08:15:45 -08:00
Leaf Petersen d0ea4371c9 Remove debugging print
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1489183002 .
2015-12-01 16:13:36 -08:00
Leaf Petersen 64ab186b16 Downwards inference. This adds support to the resolver for downwards
type inference in strong mode.  Downwards inference is removed from
the DDC checker in favor of the strong mode analyzer version.

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

Review URL: https://codereview.chromium.org/1462133005 .
2015-12-01 15:40:27 -08:00
Konstantin Shcheglov 1b9c263b56 New NodeLocator which uses positions of characters, not between them.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1490933002 .
2015-12-01 13:59:11 -08:00
Konstantin Shcheglov 6f67abeaaa Clean source maps during partition dispose.
This might fix the following exception:

Dart analysis server, SDK version 1.14.0-edge.e3457758ed7e2b24263bcbd9831cd764ce9fd110, server version 1.12.0, FATAL error: Failed to perform operation: Instance of 'PerformAnalysisOperation'
The null object does not have a getter 'modificationTime'.

NoSuchMethodError: method not found: 'modificationTime'
Receiver: null
Arguments: []

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1480393004 .
2015-12-01 07:55:27 -08:00
Konstantin Shcheglov 0067df716f Issue 25030. Fix for searching variable declaration when there is no whitespace after the type.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25030

Review URL: https://codereview.chromium.org/1484713002 .
2015-11-30 08:17:39 -08:00
Brian Wilkerson 86216e5154 Consistently use implements when one interface inherits from another interface
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1481273002 .
2015-11-30 07:58:10 -08:00
Paul Berry 617f9eea85 Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-11-27 08:07:24 -08:00
Leaf Petersen 77bd51c2dc Fix propagated argument element bug. This fixes #25040.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1477953002 .
2015-11-25 15:50:20 -08:00
Brian Wilkerson 29b3e53207 Remove duplicated stack trace from error notifications
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1480663002 .
2015-11-25 09:15:47 -08:00
Brian Wilkerson e94c820411 Revert "Ensure that a complete library element has constants evaluated (issue 24890)"
Review URL: https://codereview.chromium.org/1480603002 .
2015-11-25 07:13:08 -08:00
Brian Wilkerson c8cec941ef Ensure that a complete library element has constants evaluated (issue 24890)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1468293003 .
2015-11-25 06:37:45 -08:00
Paul Berry 9a08061581 Add support for assert statements with messages to the analyzer.
Support is disabled by default.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1480433002 .
2015-11-24 15:50:45 -08:00
Konstantin Shcheglov cfb7d61a9c Issue 25034. Record only the target source's errors.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25034

Review URL: https://codereview.chromium.org/1477553002 .
2015-11-24 14:00:00 -08:00
John Messerly 7feb6b7cb7 fix return type comment parsing for top-level generic function
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1465153005 .
2015-11-24 11:21:30 -08:00