Commit Graph

3034 Commits

Author SHA1 Message Date
Paul Berry aa64ca9554 Eliminate emptyCommentAndMetadata() from parser tests.
This allows the parser tests to be rewritten in a way that will make
them easier to adapt to testing Fasta, because they no longer make
assumptions about data structures passed around inside the parser.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2684703007 .
2017-02-08 14:16:17 -08:00
Paul Berry 67463b0f7d Make some parser test helper methods non-static.
This paves the way for allowing more of analyzer's parser tests to be
run on both Fasta's parser and the analyzer parser.

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

Review-Url: https://codereview.chromium.org/2683543006 .
2017-02-08 08:24:55 -08:00
Paul Berry 5c3ad68f13 Rename parser_test_fasta.dart to parser_fasta_test.dart.
Tests must be named "..._test.dart" in order to be run by the build
bots.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2682753002 .
2017-02-07 11:12:49 -08:00
Paul Berry 62604294a2 Begin hooking up Fasta to analyzer parser tests.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2672403004 .
2017-02-07 05:45:58 -08:00
Leaf Petersen a3b4366f11 Infer Null for return type of functions with empty returns.
This allows inference to infer Null as the return type of functions
which have no return statements, or which return with no value.

Also allows inference to propagate Null.

Fixes https://github.com/dart-lang/sdk/issues/28602
Fixes https://github.com/dart-lang/sdk/issues/28630

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

Review-Url: https://codereview.chromium.org/2667343005 .
2017-02-06 12:24:39 -08:00
Konstantin Shcheglov f023492a1d Don't use Element.computeNode() in resolver tests.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2676183002 .
2017-02-06 06:55:01 -08:00
Leaf Petersen 3fa3964a70 Suppress NO_DEFAULT_BOUND errors.
This suppresses the emission of NO_DEFAULT_BOUND errors, and makes the
default instantation for recursive bounds backwards (and possibly
forwards) compatible.  Also adds a couple of currently failing tests
for cases that should be made erroneous regardless of whether we
choose to support malbounded type constructor applications.

BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2662973005 .
2017-02-01 10:18:05 -08:00
Brian Wilkerson efd28ece97 Fix errors and warnings
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2661263002 .
2017-02-01 08:06:30 -08:00
Konstantin Shcheglov c55185d9d7 Fix for PartDirective annotations while applying resynthesized element model.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2662173004 .
2017-01-31 11:45:03 -08:00
Paul Berry b3237d0ad8 Remove analyzer workaround for #27447.
This issue was fixed in the SDK sufficiently long ago that it doesn't
seem necessary to keep the workaround in analyzer.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2662033002 .
2017-01-30 13:04:26 -08:00
Paul Berry c9b692e8d9 Add a temporary analyzer error to work around #28515
Analyzer summaries do not yet support generic function-typed
parameters.  To avoid user confusion, generate an error if the user
tries to use a generic function-typed parameter.

The error can be worked around by using a typedef or changing generic
types to `dynamic`.

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

Review-Url: https://codereview.chromium.org/2656303004 .
2017-01-29 07:35:03 -08:00
Leaf Petersen a6138dad2a Relax type bound restrictions slightly, apply to typedefs.
This relaxes the restriction on raw types in bounds slightly, to allow
parameterized types in bounds to be used without type arguments if
their bounds are empty.

This CL also fixes the error check for raw types in type bounds to
apply to typedefs as well.

BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2658303002 .
2017-01-27 18:05:03 -08:00
Jennifer Messerly 39977ac6ec fix #28526, await FutureOr<T>
fix #28527, FutureOr<T> subtyping with type parameters

For subtyping: we've had a long standing issue in how inference reuses the <: operator code. Inference needs to make sure constraints are recorded on the type parameters we're inferring, but it also needs to correctly implement the future or union. This change addresses that & is a step towards the bigger inference change upcoming that tracks top/bottom constraints explicitly.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2655273008 .
2017-01-27 15:23:30 -08:00
Brian Wilkerson 9761ff14d4 Backout part of previous commit to fix bots
Review-Url: https://codereview.chromium.org/2645283009 .
2017-01-26 11:56:06 -08:00
Brian Wilkerson 59a9861743 Fix some bugs related to the covariant keyword
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2662433002 .
2017-01-26 11:27:42 -08:00
Jennifer Messerly 0e00b3e5c8 fix #28008, fix #28009 implement FutureOr<T>
This implements FutureOr<T> in strong mode, otherwise it's ignored (treated as `dynamic`.

Also fixes strong mode's inference subtype function incorrectly treating `void` as a malformed type. This had the consequence of allowing `void` to be inferred as a type argument.

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

Review-Url: https://codereview.chromium.org/2647833002 .
2017-01-25 15:32:57 -08:00
Konstantin Shcheglov 4cd790abe3 Record isFinal for parameters into summaries.
Found this out while running shared tests with the new analysis driver.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2657583007 .
2017-01-25 15:08:37 -08:00
P.Y. Laligand d0a9768377 Fix analyzer tests.
This was failing on Windows.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2654183003 .
2017-01-25 13:25:07 -08:00
P.Y. Laligand 66cda63fea Added support for GN workspaces.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2651613003 .
2017-01-25 09:26:45 -08:00
Konstantin Shcheglov 9264c1191a Implement LibraryElement.hasExtUri for resynthesized.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2657743002 .
2017-01-25 07:03:59 -08:00
Konstantin Shcheglov b8ab9b7e17 Fix tests to run with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2656783002 .
2017-01-25 06:58:24 -08:00
Konstantin Shcheglov 608cb122e3 Fix for dart:html query() type inference.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2656673003 .
2017-01-25 06:56:28 -08:00
Jennifer Messerly 25b6e46154 fix #28141, fix super generic method bounds check
R=leafp@google.com

Review-Url: https://codereview.chromium.org/2653873002 .
2017-01-24 14:51:37 -08:00
Paul Berry 7284ab5be2 Fix summary handling of invalid annotations of the form @a.b.c.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2658483002 .
2017-01-24 13:31:26 -08:00
Konstantin Shcheglov 207dc4a5a1 Update MockSdk to be more consistent with the actual SDK, switch x_Driver tests to it.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2657533004 .
2017-01-24 12:53:48 -08:00
Konstantin Shcheglov 3e80ae9304 Make Stream abstract as it is in the actual SDK.
This requires fixes for inference tests.

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

Review-Url: https://codereview.chromium.org/2654733003 .
2017-01-24 12:50:52 -08:00
Konstantin Shcheglov d2759c6be0 Fix tests for resolving documentation with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2657663002 .
2017-01-24 11:27:40 -08:00
Konstantin Shcheglov a440bb2a6d Fix FunctionTypeAliasElementImpl.visitChildren() for type parameters.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2656673002 .
2017-01-24 11:26:07 -08:00
Leaf Petersen e58515bfa1 Strong mode inference tests.
Add some tests for local inference.  Some of these are marked failing
since they test upcoming changes to inference that haven't landed yet.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2653833003 .
2017-01-24 11:23:58 -08:00
Konstantin Shcheglov 918d9183dc Make the test analysis driver compatible.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2651053002 .
2017-01-24 11:13:23 -08:00
Konstantin Shcheglov decb720a0c Add DeclaredVariables to AnalysisDriver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2654663005 .
2017-01-24 10:57:50 -08:00
Konstantin Shcheglov ea285668ee Fix resynthesizing field of FieldFormalParameterElement.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2651683004 .
2017-01-24 10:55:47 -08:00
Paul Berry 1944ff1e69 Fix prelinker when a local name shadows an import prefix.
Fixes #28391.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2655713002 .
2017-01-24 09:02:19 -08:00
Konstantin Shcheglov 1ab863347a TypeProvider is only available after a resolution.
We're moving in the direction of resynthesizing dart:core and dart:async
classes on demand, in the same context as all the other sources. We will
not have a special AnalysisContext for SDK which we can ask TypeProvider
from.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2651743005 .
2017-01-23 13:26:44 -08:00
Konstantin Shcheglov 919d70d0cb Issue 28100. Implement new strong mode instantiate to bound rules in analyzer.
R=leafp@google.com, brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28100

Review-Url: https://codereview.chromium.org/2640143007 .
2017-01-23 10:12:32 -08:00
Konstantin Shcheglov 77943f6899 Replace more same(type) with equal(type).
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2648323002 .
2017-01-23 09:00:55 -08:00
Florian Loitsch 9a0ccfc092 Deprecate the use of Function as a class.
Shows a hint when `Function` is used:
- as a class name,
- in an extends clause,
- in a with clause.

The `Function` may or may not point to the core's `Function`. All uses of `Function` in these contexts are deprecated.

R=brianwilkerson@google.com

Committed: https://github.com/dart-lang/sdk/commit/4e6e72b0b0bc1558ea0ba695363c6dc8bf9433f5

Reverted: https://github.com/dart-lang/sdk/commit/3f871ae76f5269b50e531c61038727a074301990
Review-Url: https://codereview.chromium.org/2643073002 .
2017-01-23 17:34:09 +01:00
Florian Loitsch 5616882833 Revert "Deprecate the use of Function as a class."
This reverts commit 4e6e72b0b0.

BUG=

Review-Url: https://codereview.chromium.org/2650763002 .
2017-01-23 17:09:16 +01:00
Florian Loitsch 4e6e72b0b0 Deprecate the use of Function as a class.
Shows a hint when `Function` is used:
- as a class name,
- in an extends clause,
- in an implements clause,
- in a with clause.

The `Function` may or may not point to the core's `Function`. All uses of `Function` in these contexts are deprecated.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2643073002 .
2017-01-23 16:39:04 +01:00
Konstantin Shcheglov 79b362181f Don't use same(typeProvider.xxx) in resolver_test.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2643403004 .
2017-01-22 10:04:54 -08:00
Konstantin Shcheglov 8cf71084dc Fix GenericFunctionType parsing tests by making them fail in non-checked mode.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2652443003 .
2017-01-21 14:32:46 -08:00
Brian Wilkerson c40ec27266 Get the rest of the shared tests for covariant to pass
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2642683006 .
2017-01-20 15:04:50 -08:00
Konstantin Shcheglov f550374a6b Issue 28100. Fix for indirect not instantiated types, tests.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2646983003 .
2017-01-20 08:07:16 -08:00
Konstantin Shcheglov c7487dfaea Issue 28100. In strong mode verify that TypeParameter bound has required type arguments.
R=brianwilkerson@google.com, leafp@google.com
BUG= https://github.com/dart-lang/sdk/issues/28100

Review-Url: https://codereview.chromium.org/2641213002 .
2017-01-19 13:25:48 -08:00
Brian Wilkerson d06a2326f1 Add parser support for covariant parameters
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2639883005 .
2017-01-19 09:38:35 -08:00
Asger Feldthaus 76442f9394 Fix language/bad_constructor_test in dartk and analyzer.
The test was incorrect because it did not declare that a static warning
was to be expected due to an unresolved reference to 'q'. The unresolved
reference has been removed as it has nothing to do with what it is
supposed to test.

The analyzer was incorrect in that a setter was reported to clash with
a constructor of the same name, but this failure was hidden by the
above issue. This has been fixed.

dartk inherited the issue (and its fix) from the analyzer, but some
additional error handling was needed in dartk to avoid crashing.

Closes https://github.com/dart-lang/sdk/issues/11576

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

Review-Url: https://codereview.chromium.org/2643693002 .
2017-01-19 13:10:32 +01:00
Brian Wilkerson ae24866083 Disable generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2640963003 .
2017-01-18 14:17:14 -08:00
Konstantin Shcheglov 9567d2934a Implement UriResolver.restoreAbsolute() for DartUriResolver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2640793005 .
2017-01-18 14:12:42 -08:00
Konstantin Shcheglov 0160332713 Issue 28027. Move Null to the bottom in the Analyzer.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/28027

Review-Url: https://codereview.chromium.org/2638183002 .
2017-01-18 11:15:11 -08:00
Konstantin Shcheglov 8d326e9a14 Report StateError if the DartSDK for an AnalysisDriver does not have summary.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2639743002 .
2017-01-17 20:46:00 -08:00