Commit Graph

7128 Commits

Author SHA1 Message Date
Brian Wilkerson 0f30af628a Fix computation of errors to not run extra tasks
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1370323003 .
2015-09-30 11:55:17 -07:00
Konstantin Shcheglov 1d28f99524 Fix for 'implemented' notification after an incremental change.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org//1374943005 .
2015-09-30 11:08:41 -07:00
John Messerly 20e1f91fbb fix inference of hashCode with library prefix
fixes https://github.com/dart-lang/dev_compiler/issues/349

R=leafp@google.com

Review URL: https://codereview.chromium.org//1374813002 .
2015-09-28 16:02:10 -07:00
John Messerly 253fc292cb fix inference of object members on library prefix
See https://github.com/dart-lang/dev_compiler/issues/349 for context.

The prefix fix handled `toString()` but not `library_prefix.toString()`

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

Review URL: https://codereview.chromium.org//1374773003 .
2015-09-28 14:40:20 -07:00
Konstantin Shcheglov ac282f8a1d Fix for the libraries to parts map.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1377613002 .
2015-09-28 13:21:41 -07:00
Leaf Petersen 9be2107f39 Improve the handling of inference for instance fields in the task model
strong mode inference.  This CL adds instance fields to the set of variables
for which dependencies are computed, and re-resolves each instance field
initializer using type information inferred for the static variables upon
which it depends.

This CL also stops static variables with existing type information from having
their types overwritten.

This CL ports over a number of the DDC inference tests, more remain to be ported.

There is still at least one outstanding issue with instance variable inference,
see #354 (and the two tests marked fail added in this CL).

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1370793002 .
2015-09-28 10:57:04 -07:00
John Messerly 9ac032d545 infer field formal parameter types
this fixes https://github.com/dart-lang/dev_compiler/issues/346

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1371813002 .
2015-09-28 09:20:20 -07:00
John Messerly 7bd3db6d74 analyzer strong mode: infer final field from initializer if super getters are dynamic
fixes https://github.com/dart-lang/dev_compiler/issues/348

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

Review URL: https://codereview.chromium.org//1367183004 .
2015-09-25 17:49:55 -07:00
John Messerly c09b338e25 fix inference of object members when a method has no target
we incorrectly thought `toString()` was a call to `Object.toString()`

See https://github.com/dart-lang/dev_compiler/issues/349 for more context

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1368793004 .
2015-09-25 17:22:56 -07:00
Konstantin Shcheglov 3924b15d85 Remove ElementLocator.locateWithOffset altogether.
It was needed only for the old Angular implementation support, which
overlayed its own Element subclasses into normal Dart AST, for example
for string literals - names of components.

As we don't support this anymore, there is no need for the method.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1370833002 .
2015-09-25 14:57:15 -07:00
Konstantin Shcheglov 6c029f9cb1 Issue 24440. Fix for renaming libraries using 'part of' directives.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24440

Review URL: https://codereview.chromium.org//1364853007 .
2015-09-25 14:24:05 -07:00
John Messerly 59eb287389 [analyzer] copy generic type args when inferring a new function type for an ExecutableElement
This matches what resolver.dart visitMethodDeclaration does when it creats the FunctionTypeImpl for the method. So we want to preserve these generic type args when we're building the new inferred function type, otherwise we'll fail to substitute them later on.

Context: https://github.com/dart-lang/dev_compiler/issues/342#issuecomment-142748853

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1364353003 .
2015-09-25 10:03:10 -07:00
Vijay Menon cac248765b Remove CompilationUnit name requirement
Some of our language tests have '.lib' extensions for dart files that are imported.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1372433003 .
2015-09-24 15:51:08 -07:00
pq 5dd6a543e7 Plugin manifest parsing.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1366023002 .
2015-09-24 14:53:15 -07:00
John Messerly 83a2449062 Infer setter parameter types in strong mode
This change also decouples setters and getters, which matches what DDC currently does. The benefit is they're inferred as independent methods, which allows code reuse between method/getter/setters. It also prevents ordering issues that might occur otherwise (i.e. if getter inference considers setter's type, and setter inference considers the getter's type).

More context: https://github.com/dart-lang/dev_compiler/issues/342#issuecomment-142713453

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1359243003 .
2015-09-24 13:21:04 -07:00
John McCutchan 9535715f92 Fix handling of empty .analysis_options files and test this case
Fixes #24431

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1369573003 .
2015-09-24 12:38:53 -07:00
pq 7ff04709e7 Plugin config cleanup.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1366663002 .
2015-09-23 10:44:02 -07:00
pq e2ec118554 Plugin config format validation (and tests).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1362033002 .
2015-09-23 09:51:29 -07:00
Leaf Petersen ff86501c85 This adds support for a DDC special case of inline JS. It also addresses an issue from an earlier CL, makes some readability improvements, and eliminates some now-redundant TODOs.
BUG=
R=scheglov@google.com, vsm@google.com

Review URL: https://codereview.chromium.org//1355393003 .
2015-09-23 08:58:04 -07:00
Konstantin Shcheglov 27a8bbd415 Reset Source modification stamp to -1 if it does not exist.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1361003002 .
2015-09-23 08:20:12 -07:00
pq f4c3b30d8a Basic plugin config parsing.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1364493004 .
2015-09-22 17:06:14 -07:00
Leaf Petersen 4fe661995d Add additional strong mode inference. This adds in all the remaining inference cases from the strong mode RestrictedStaticTypeAnalyzer.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1352763004 .
2015-09-22 14:03:08 -07:00
pq f02dd6b82c Unused import cleanup.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1349393004 .
2015-09-22 09:49:16 -07:00
Konstantin Shcheglov 3aabaa96e6 Fix for a stupid copy/paste bug in the incremental resolver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1360583003 .
2015-09-21 09:17:35 -07:00
Konstantin Shcheglov fcb0c319da Fix for updating HINTS during incremental resolution with TM.
The key change is not updating LIBRARY_UNIT_ERRORS in IncrementalResolver.
Otherwise it becomes VALID and we don't recompute it, so don't recompute HINTS.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1355503004 .
2015-09-18 13:41:09 -07:00
Leaf Petersen f912eabcbf Make type system changes backwards compatible
This CL eliminates the additional typeSystem arguments added to the API by https://codereview.chromium.org/1329743005/  wherever possible, instead projecting out the typeSystem from the context as available.  Where not possible, the additional argument is made optional, defaulting to the standard TypeSystemImpl.  I believe that the result of this should be backwards compatible for clients (but not implementors) of the API.

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

Review URL: https://codereview.chromium.org//1355773002 .
2015-09-18 09:59:12 -07:00
Harry Terkelsen f4426b109b Do not emit semicolons for await expressions in ToSourceVisitor
Closes #24364

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

Review URL: https://codereview.chromium.org//1345403002 .
2015-09-17 11:20:45 -07:00
Konstantin Shcheglov ff95a65900 Reset AnalysisDriver on priority sources changes.
It turned out that our WorkManager(s) don't have the problem we discussed.
We remove targeted results from queues only when they are VALID or ERROR.
So, reset is safe to do.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1350993002 .
2015-09-17 07:57:51 -07:00
Leaf Petersen a19bd39da8 First cut at abstracting over the type system. This factors out uses of isAssignableTo and isSubtypeOf into calls through a type system object. Currently there is only one kind of type system, which just falls over to the existing implementations.
BUG=
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1329743005 .
2015-09-16 14:55:59 -07:00
Konstantin Shcheglov aab6cf0b35 Produce LINE_INFO for HTML files.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1347223002 .
2015-09-16 13:28:16 -07:00
Konstantin Shcheglov 4e18780ded Tweak for incremental result updates.
The result itself is not invalidated, but everything dependent on it is.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1339603004 .
2015-09-14 13:21:16 -07:00
Brian Wilkerson 004839fc86 Fixes for the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1342903002 .
2015-09-14 13:16:08 -07:00
Konstantin Shcheglov e878562d35 Add an extension point for contributing to HTML_ERRORS.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1341723003 .
2015-09-14 12:00:39 -07:00
Brian Wilkerson e84d069467 Fixed the last unit test that was failing with the new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1327363002 .
2015-09-11 08:47:05 -07:00
Konstantin Shcheglov 57958d7643 Keep known valid Dart results and invalidate all the other results during incremental resolution.
By doing this we invalidate Angular results, so cause their recomputing and
updating Angular specific errors and resolved ranges.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1331223003 .
2015-09-11 07:59:23 -07:00
Brian Wilkerson 5b925adf82 Addition bug fixes for new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1331843004 .
2015-09-10 08:10:29 -07:00
Brian Wilkerson 4797c5fecc Fix incremental resolution tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1318943006 .
2015-09-09 10:03:51 -07:00
Brian Wilkerson 24b24a3569 Reformat code to reduce churn
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1322513004 .
2015-09-09 08:19:41 -07:00
Brian Wilkerson de51d0ab45 Improve failure message
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1315233007 .
2015-09-08 15:07:15 -07:00
Brian Wilkerson 8b9c5f231e Remove unneeded test
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1310593004 .
2015-09-08 13:24:09 -07:00
Brian Wilkerson 5efe30d458 Stop propagating return types for top-level function declarations
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1309243007 .
2015-09-08 13:14:36 -07:00
Brian Wilkerson 38bf731d54 There are several improvements:
- analyzer no longer reports errors in the initializers for static variables until the final resolution
- the collection of static variables is now computed more efficiently
- an unused analysis result is no longer being computed

In addition, this fixes several (but not all) of the tests that fail when the task model is enabled.

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

Review URL: https://codereview.chromium.org//1305863011 .
2015-09-08 10:12:20 -07:00
Paul Berry 5ea1238b56 Fix handling of shortcutting expressions and asserts in ExitDetector.
Fixes #24293.
Fixes #24294.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1331433003 .
2015-09-07 12:23:33 -07:00
Brian Wilkerson cbbedf61db Remove useless tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1322303003 .
2015-09-03 14:19:48 -07:00
Brian Wilkerson 0bf186526c Remove obsolete resolution task
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1306323004 .
2015-09-03 14:04:49 -07:00
Brian Wilkerson b0b97813f3 Add the task to resolve function bodies
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1326553003 .
2015-09-03 08:08:53 -07:00
Leaf Petersen f90c09df48 Strong mode foreach inference. Infer the type of declared identifiers
in foreach blocks.

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

Review URL: https://codereview.chromium.org//1323513005 .
2015-09-01 17:37:58 -07:00
Brian Wilkerson 17dbad18e9 Clean up and improve some of the task tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1320273003 .
2015-08-31 16:55:23 -07:00
Brian Wilkerson fbd968c8e5 Handle cycles when infering static variables
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1319703003 .
2015-08-31 14:27:59 -07:00
Brian Wilkerson de4280fa14 Implement task to infer instance members
R=leafp@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1322983002 .
2015-08-31 14:23:44 -07:00