Commit Graph

1913 Commits

Author SHA1 Message Date
Paul Berry 058dd73f1d Fix instantiateToBounds behavior in summary resynthesizer to match that of StrongTypeSystemImpl.instantiateToBounds.
Note that StrongTypeSystemImpl.instantiateToBounds misbehaves if the
bound on one type parameter refers to a later type parameter.  I'm not
sure what the intended behavior is in this case, so I've filed
dartbug.com/27072.  Once that is fixed we can refine the behavior of
the summary resynthesizer further.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2244043002 .
2016-08-12 17:29:21 -07:00
John Messerly e36fa2b3be fix #26120, sideways casts no longer supported
R=vsm@google.com

Review URL: https://codereview.chromium.org/2231273002 .
2016-08-12 14:32:36 -07:00
Paul Berry 052a6c867d Fix summary handling of unresolved imports, exports, and parts.
Previously this was working for a few use cases by dumb luck, but it
wasn't well tested and became broken by
b29c6bf330.  This CL fixes it for real
and adds tests to verify the fix.

Note that there is a change to how we represent an unresolved
import/export: instead of storing a URI_EXISTS modifier in the element
model, we simply mark the imported library element as synthetic.
(This library element existed anyway; we just weren't marking it as
synthetic).  This makes it easy to tie in with summaries, since it is
easy for the resynthesizer to detect that the library doesn't exist at
the time the library handle is resolved.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2235373003 .
2016-08-12 13:59:51 -07:00
Konstantin Shcheglov a3a031195a Add DartSdk.getLinkedBundle() and use it in PubSummaryManager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2242963002 .
2016-08-12 12:11:03 -07:00
Konstantin Shcheglov 9f187f3df5 Normalize paths in PhysicalResourceProvider.getFile()/getFolder().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2239303004 .
2016-08-12 11:04:02 -07:00
Konstantin Shcheglov df4baa4332 Fix resolveRelativeUri() to handle correctly empty contained Uri(s).
This was breaking linking with `package` Uri(s).
I also added a new test that exhibits this behaviour.

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

Review URL: https://codereview.chromium.org/2242883003 .
2016-08-12 10:59:33 -07:00
Brian Wilkerson c41427383b Deprecate DirectoryBasedDartSdk and transition existing uses to the new API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2242853002 .
2016-08-12 09:18:12 -07:00
Konstantin Shcheglov b290ea105f Use existing unlinked bundles even for packages outside of the pub cache.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2232403002 .
2016-08-11 14:11:04 -07:00
Konstantin Shcheglov bcd9642d84 Link with exports dependencies.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2243463003 .
2016-08-11 14:09:08 -07:00
Brian Wilkerson 110c0f7e0e Prototype for package-specific cache partitions
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2237893002 .
2016-08-11 14:04:17 -07:00
Konstantin Shcheglov e1fd213d55 Link packages with an SDK extension.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2231413003 .
2016-08-11 12:43:45 -07:00
Konstantin Shcheglov bd1c47146e Compute the linked bundle for the SDK extension.
As Brian noticed, we have at most one extension, it would be waste to
implement general multi-extension linking. So, for now we have support
only for one.

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

Review URL: https://codereview.chromium.org/2240593002 .
2016-08-11 11:21:02 -07:00
Konstantin Shcheglov 18b6c12f61 Rewrite SdkExtUriResolver into reflective.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2243493002 .
2016-08-11 09:28:59 -07:00
Konstantin Shcheglov 296d81f60a Issue 27053. Record errors in InferStaticVariableTypeTask and include them into unit errors.
R=brianwilkerson@google.com, jmesserly@google.com
BUG=

Review URL: https://codereview.chromium.org/2239613002 .
2016-08-11 09:10:31 -07:00
John Messerly af13ca9e25 fix wrong order to isAssignableTo for override params
Also renames the easy-to-miss overridden/overriding to the more clear base/derived, so these bugs will come up less often.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2236763002 .
2016-08-10 17:50:33 -07:00
John Messerly 9242687547 fix #27036, pass definite function types to LUB
R=vsm@google.com

Review URL: https://codereview.chromium.org/2221233002 .
2016-08-10 15:29:51 -07:00
Brian Wilkerson c1c6e95054 Convert ContextBuilder to use FolderBasedSdk
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2235583003 .
2016-08-10 14:56:21 -07:00
Konstantin Shcheglov 5f864e237a Add support for package cycles linking, more tests.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2227393002 .
2016-08-10 14:53:20 -07:00
Konstantin Shcheglov e1fa540dc5 Compute both strong and spec mode unlinked bundles.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2233083002 .
2016-08-10 14:41:56 -07:00
Brian Wilkerson 2657536034 Create new error message for missing generated files
R=scheglov@google.com, skybrian@google.com

Review URL: https://codereview.chromium.org/2232863004 .
2016-08-10 12:42:14 -07:00
John Messerly efa73a440e fix #26812, function types should support the call method
R=leafp@google.com

Review URL: https://codereview.chromium.org/2226903003 .
2016-08-10 10:33:25 -07:00
Konstantin Shcheglov fa11df13ca Fix for updating documentationComment for top-level variables.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2238443003 .
2016-08-10 10:29:12 -07:00
Brian Wilkerson 07850a6562 Remove false positive from override hint
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2228233003 .
2016-08-10 06:12:41 -07:00
Konstantin Shcheglov de837749a2 Basic linking in PubSummaryManager.
Many features are not implemented yet, but I'd like to show to you and
if it a step in the correct directlion, land it.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2226973005 .
2016-08-09 18:03:13 -07:00
John Messerly 1c7aca0d6d fix #25944, improve Future.then inference
also fixes #25322, return values of async functions are T | F<T>

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

Review URL: https://codereview.chromium.org/2208953002 .
2016-08-09 16:04:26 -07:00
Brian Wilkerson b29c6bf330 Suppress follow-on errors when a file is imported with either a prefix or a show clause
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2226613004 .
2016-08-09 11:11:39 -07:00
Paul Berry 1229cb7ee9 Make API signature based only on unlinked data.
Note that this is safe because linked data can be fully derived from
unlinked data.

This should make it more useful for the PubSummaryManager, which only
stores unlinked data at the moment.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2228083002 .
2016-08-09 10:18:38 -07:00
John Messerly eafe459b0e fix #26896, mark all @proxy ops as dynamic
This was already working for calls/methods because we fail to get a FunctionType. But it wasn't working for other cases like operators.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2223343002 .
2016-08-09 10:15:03 -07:00
Konstantin Shcheglov 6df5ea27a5 Revert 6ad38498c8 (PARSED_UNIT).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2231473002 .
2016-08-09 10:14:18 -07:00
Paul Berry 902ce5e739 Record information about a summary's dependencies in the summary itself.
The idea is that we can use this information to help discover related
summary files, and determine when summaries need to be re-linked.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2226093002 .
2016-08-09 09:31:04 -07:00
Konstantin Shcheglov 43fef756ae Provide LINE_INFO from ResynthesizerResultProvider.
Also, to guarantee that LINE_INFO is computed, we need to replace
context.getLineInfo() with context.computeLineInfo() in the server.
This should be equivalently fast in both summary (from provider) and
non-summary cases (the source should have been scanned and parsed in
order to resolve references to its elements).

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2225893003 .
2016-08-09 09:12:24 -07:00
John Messerly 8e9b77dd42 fix #26155 - optional param passed to positional was not inferred
R=vsm@google.com

Review URL: https://codereview.chromium.org/2230513002 .
2016-08-09 09:10:44 -07:00
John Messerly cdcc426f82 fix #26139, allow inferring a more precise return type
we were losing a lot of information on statement lambdas

R=vsm@google.com

Review URL: https://codereview.chromium.org/2225413002 .
2016-08-09 08:49:24 -07:00
Konstantin Shcheglov c35fb3c79d Initial implementation of pub summary manager.
For now we just generate unlinked, spec summaries.
We don't use them.

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

Review URL: https://codereview.chromium.org/2220703002 .
2016-08-09 07:18:52 -07:00
Konstantin Shcheglov 6ad38498c8 Extract unresolved AST parsing (PARSED_UNIT1) from full parsing, which includes UriBasedDirective(s) resolution.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2229603003 .
2016-08-08 14:45:27 -07:00
John Messerly ed416bb6cb fix #26393, treat tear offs as definite functions
R=vsm@google.com

Review URL: https://codereview.chromium.org/2212233003 .
2016-08-08 14:29:20 -07:00
Paul Berry 281322870e Rework linker tests to use SummaryDataStore.
Also add a test to make sure that things work properly when one
summary has a dependency on another.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2225163002 .
2016-08-08 13:58:33 -07:00
Konstantin Shcheglov b3588f44fe Add line starts into unlinked units.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2223113002 .
2016-08-08 11:40:05 -07:00
Stan Manilov f5f4bb4ebd Disallow uninitialized non-nullable variables
Declaring a non-nullable variable without initializing it is a static
error. If a constant is declared instead (either run-time or
compile-time) the error handling logic is the same as before.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2219653005 .
2016-08-05 11:07:46 -07:00
John Messerly efe9f1140d fix #26965, allow promotion from type param upper bound in strong mode
Also updates the changelog with this, and adds notes on a few other missing strong mode features.

R=leafp@google.com

Review URL: https://codereview.chromium.org/2214833002 .
2016-08-05 08:51:44 -07:00
John Messerly 1bb6da7937 fix #26414, infer return types of local functions
R=leafp@google.com

Review URL: https://codereview.chromium.org/2209293002 .
2016-08-05 07:25:14 -07:00
John Messerly 8026c9509c fix #26552, improve null coalescing inference
R=leafp@google.com

Review URL: https://codereview.chromium.org/2217693003 .
2016-08-05 07:19:47 -07:00
Paul Berry 70bd623f36 Add an "api signature" to summaries.
The API signature of a summary is an MD5 hash of the API of the code
being summarized.  This will be used by analysis server to detect when
a summary needs to be relinked (because it was built with reference to
another summary whose API has since changed).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2216873003 .
2016-08-04 16:12:49 -07:00
John Messerly 3c38f96a0a add a test for #26431, which is now fixed
likely was fixed by the constructor inference changes

R=nweiz@google.com

Review URL: https://codereview.chromium.org/2214123002 .
2016-08-04 15:50:10 -07:00
John Messerly 9599cd6f50 fix #26512, correct handling of fuzzy arrows in strong mode LUB
R=leafp@google.com

Review URL: https://codereview.chromium.org/2215873002 .
2016-08-04 15:47:27 -07:00
Konstantin Shcheglov bc8b32145b Fix for adding new elements into library cycles.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2212093002 .
2016-08-04 14:42:40 -07:00
Stan Manilov f3f10a6dd6 Make LUB algorithm aware of non-null types
In addition to the functional change I added some more tests to test for
regressions and for the new behaviour.

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2208233002 .
2016-08-04 12:33:34 -07:00
Konstantin Shcheglov 52af64c7ff Fix incremental resolution when inserting/removing empty lines before comments.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2214943002 .
2016-08-04 11:48:05 -07:00
John Messerly 5d8b2b5eac fix #26962, invoking a known lambda is not a dynamic invoke
R=leafp@google.com

Review URL: https://codereview.chromium.org/2211053002 .
2016-08-04 11:30:26 -07:00
Brian Wilkerson 5b26441dbf Convert server and cli and deprecate the old implementation
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2214613003 .
2016-08-04 11:28:16 -07:00