Commit Graph

393 Commits

Author SHA1 Message Date
Vijay Menon fad85a6bfa Broken test fixes
These tests break on all backends.  It looks like the original intent was to run to completion.

Change-Id: I895638c522285f280cbb608c82a8a496bfd11d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98302
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-04-03 13:12:23 +00:00
Erik Ernst 69790e7eb4 Updated Dart.g, tests & status files to support ui-as-code collections
Change-Id: I9ba3aa4e3ebaedee3a2cd20ccdcc533af96b9bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98018
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-03-29 13:33:52 +00:00
Konstantin Shcheglov f841096701 Fix for crash if MixinDeclaration has a const constructor.
R=brianwilkerson@google.com

Bug: https://buganizer.corp.google.com/issues/124304191
Change-Id: I78f07338c3ac4c254986fb2b19a00bb5fd4201b7
Reviewed-on: https://dart-review.googlesource.com/c/92860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 22:16:12 +00:00
Paul Berry f0793a937c Fix analyzer status for const_constructor3_test.
The test passes now.

Change-Id: Id121e108c2b2585bb1a553383f76edd983a90c72
Reviewed-on: https://dart-review.googlesource.com/c/90600
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-01-23 00:34:32 +00:00
Mike Fairhurst ca9ea997bd Fix old treatment of {}, enable set literals tests
Change-Id: Iec319cb735a3747e64561f3865cce2f08fb2be0f
Reviewed-on: https://dart-review.googlesource.com/c/88601
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-01-10 01:38:34 +00:00
Mike Fairhurst 88e6fe0f67 testing: refer to issue 35508 in status file entry
Change-Id: Ia81fa274ee26bee638a1c5f638edc194270f8b0e
Reviewed-on: https://dart-review.googlesource.com/c/88124
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-12-27 21:02:52 +00:00
Konstantin Shcheglov 9cf51348d4 Issue 33553. For get/set. Don't report ABSTRACT_SUPER_MEMBER_REFERENCE if the nominal superclass has noSuchMethod().
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/33553
Change-Id: Ic0e142519a839607560ae0d0e551424a9b32c954
Reviewed-on: https://dart-review.googlesource.com/c/84045
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-12 17:31:25 +00:00
Paul Berry 4b1870307d Merge commit '8d12600b16bcc9ae113c47fb6a3d5b68b1388c5c' into analyzer 2018-11-06 14:59:15 -08:00
Konstantin Shcheglov 6906ce3964 Issue 33553. Don't report ABSTRACT_SUPER_MEMBER_REFERENCE if the nominal superclass has noSuchMethod().
Bug: https://github.com/dart-lang/sdk/issues/33553
Change-Id: I37ef61ed57d5a479771c7e76a78f7f6fcb99e28b
Reviewed-on: https://dart-review.googlesource.com/c/82947
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 16:41:37 +00:00
Lasse R.H. Nielsen 095d694add Add tests for set literals.
Change-Id: Ia5e576e801bd4c9dd3fabca5f11c8e4f86e98803
Reviewed-on: https://dart-review.googlesource.com/c/82840
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-11-06 13:47:35 +00:00
Paul Berry 40dee8da38 Merge commit '11707cab410906df65b72e94fd59b2f51690c9e7' into analyzer 2018-11-05 10:00:59 -08:00
Erik Ernst 4cf179bcf1 Corrected outdated tests string_split_test and string_supertype_checked
Change-Id: I9ecb49d921b3df1bb5cda63b65e6ae07e618110d
Reviewed-on: https://dart-review.googlesource.com/c/82721
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2018-11-05 14:21:19 +00:00
Paul Berry 5089649b15 Merge commit '98a0309fbd8a53ceb4f5520c530507e135930eab' into analyzer 2018-10-30 14:58:31 -07:00
Konstantin Shcheglov 3a374373bc Protect against self-referencing classes in UnheritanceManager2.
R=brianwilkerson@google.com, paulberry@google.com

Fixes: https://github.com/dart-lang/sdk/issues/34333
Change-Id: Iffa100bd172afe879549c78a2871d8b8d36c7c8a
Reviewed-on: https://dart-review.googlesource.com/c/81661
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-29 21:05:24 +00:00
Paul Berry 1894056c71 Merge commit '4aaa9660148fabc25a259a602c49ae924c33e378' into analyzer 2018-10-26 05:58:56 -07:00
Martin Kustermann dec268cfae [VM] Catch non-instantiated type arguments for constant partial instantiation expression
This makes us report the following error

  * in JIT:

  Unhandled exception:
  'test.dart': error: Type arguments must be instantiated in partial instantiation.
  #0      main (...)
  ...

  * in AOT:

  test.dart:7:28: Error: The type '#lib1::C::T' is not a constant, only instantiated types are ...
    const C({this.callback = _defaultCallback});
                           ^
  test.dart:7:17: Context: While analyzing:
    const C({this.callback = _defaultCallback});
                ^
  test.dart:5:37: Error: The type '#lib1::C::T' is not a constant, only instantiated types are ...
    void foo([dynamic Function(T) f = _defaultCallback]) {}
                                    ^
  test.dart:5:33: Context: While analyzing:
    void foo([dynamic Function(T) f = _defaultCallback]) {}
                                ^
  test.dart:11:38: Error: The type '#lib1::bar::T' is not a constant, only instantiated types are ...
  void bar<T>([dynamic Function(T) f = _defaultCallback]) {}
                                     ^
  test.dart:11:34: Context: While analyzing:
  void bar<T>([dynamic Function(T) f = _defaultCallback]) {}



Issue https://github.com/dart-lang/sdk/issues/32912

Change-Id: I05c7019119a50a9cc38939d9cb41aeaa06c853bc
Reviewed-on: https://dart-review.googlesource.com/c/81278
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-25 09:23:18 +00:00
Paul Berry 5954a3e5d0 Merge commit '6443a8036d3914f28f1d1e140a108487953cd909' into analyzer 2018-10-23 06:03:57 -07:00
Lasse R.H. Nielsen 03765ed6ec Update old mixin tests. Remove the --super-mixins flag from the tests.
Bug: http://dartbug.com/34781
Change-Id: Ib07e1927e7de35ff0c48514b9e89da65a5f192dd
Reviewed-on: https://dart-review.googlesource.com/c/79700
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-10-23 08:35:49 +00:00
Paul Berry 5665636983 Merge commit '7fd78ed5b606e64d30ec201de9adce6fdf8856ba' into analyzer 2018-10-22 13:07:24 -07:00
Konstantin Shcheglov c44fa48f8f Extract and rewrite MethodInvocation resolution.
This is a copy of https://dart-review.googlesource.com/c/sdk/+/78182,
but now in the analyzer branch.

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

Change-Id: I75d17a351ee7a33c164d560009cf3ffd088d956a
Reviewed-on: https://dart-review.googlesource.com/c/80942
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 03:36:30 +00:00
Daniel Hillerström 5d1832b20a Disallow factory constructors in mixin declarations.
Signal a compile-time error if a mixin declaration contains a factory
constructor (regardless of whether it is redirecting). Note, this only
applies to _mixin declarations_, derived mixin classes can still
contain factory constructors.

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

Change-Id: I713b623316664ea360f896789d8e619ad6f07ca5
Reviewed-on: https://dart-review.googlesource.com/c/80100
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-10-17 05:44:46 +00:00
Brian Wilkerson 2ec7c9cdb1 Skip the tests that require super mixin support
Change-Id: I3c041757580a041cdf3e42f6e38d22d3c10cd5a2
Reviewed-on: https://dart-review.googlesource.com/c/79475
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-13 00:51:24 +00:00
Brian Wilkerson 63c9a241e3 Upgrade WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR from a warning to an error
Change-Id: I8f6571d52d48c76be9a05325d6ca216463007a82
Reviewed-on: https://dart-review.googlesource.com/c/79382
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-11 21:20:48 +00:00
Dan Rubel e4c3fa0a9c Improve recovery when parsing named constructor invocation with invalid type arguments
The parser now generates a ConstructorWithTypeArguments error and a new
handleInvalidTypeArguments event after a begin/endTypeArguments event pair
when those type arguments are in a syntatically invalid location.

For example: `new C.n<int>();` in
```
class C<T> { T f; C.n() {} }
main() { var x = new C.n<int>(); }

Most listeners handle this event by dropping the invalid type arguments,
but AstBuilder now preserves those invalid type arguments in the AST
to support better code quick-fixes/quick-assists/refactoring.

Change-Id: I5b22bd4903cd9ee3645936b9a108598b603cf9ca
Reviewed-on: https://dart-review.googlesource.com/c/79300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-11 19:57:22 +00:00
Jenny Messerly 472c898c87 [dartdevc] fix for-in loop variable shadowing a var used in initialzer
Dart for-in loops allow `var x = [1]; for (var x in x) {}`, which is not
allowed in JS. If this pattern is detected, a temporary variable is
introduced so the for-in initializer expression is evaluated outside of
the JS for-of loop.

(This issue seems to be unique to for-in loops. For loops and other
kinds of variable declarations of the form `var x = ...` are not
allowed to use `x` in the initializer, even if `x` is declared in an
outer scope.)

Also fixes an out-of-date comment in the DDC+Analyzer backend.

Change-Id: I35b272a5a311f7b6f104cc82a99cc83a6ed5c247
Reviewed-on: https://dart-review.googlesource.com/c/79142
Commit-Queue: Alan Knight <alanknight@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2018-10-11 17:07:39 +00:00
Brian Wilkerson 2cf6ba2996 Generate the right error message for type arguments on a named constructor
Change-Id: If6e9e943b71b00429c8fc5618f1337e8b7ac46b6
Reviewed-on: https://dart-review.googlesource.com/c/78560
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-09 18:38:39 +00:00
Mike Fairhurst 7f531b5112 Analyzer: Fix missing errors during (a)sync(*) yield of void.
Change-Id: Iff1d87862b2f684c0ce36b0f07620f62f2e49a85
Reviewed-on: https://dart-review.googlesource.com/c/78323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-08 22:27:59 +00:00
Mike Fairhurst 765b8e2d66 More void cleanup
Change-Id: I21e23ab6dec654242d049935e2665389e61dd3d7
Reviewed-on: https://dart-review.googlesource.com/c/78189
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-05 15:34:31 +00:00
Aske Simon Christensen bb2775b16a Only perform override check on declared members.
The code in class_hierarchy.dart that looped over override pairs
included implementations inherited from its superclass as potential
overriders, presumably in a broken attempt to include some interface
checks into the mix.

With this problem fixed, the special case in kernel_class_builder.dart
that excluded overriders not declared in the current class (i.e.
declared in a mixin) could be removed without incurring false
positives.

These override checks performed on members from a mixin produce an
extra context message indicating the class where the two members meet,
giving rise to the override relation (similarly to interface checks).

Since the same member can now override more than one member (or even
the same member more than once), the diagnostics message duplication
check has been extended to also include the context in the comparison.

Fixes https://github.com/dart-lang/sdk/issues/34235
Fixes https://github.com/dart-lang/sdk/issues/34285

Change-Id: I990e5719ae1749fd1aad1ad478aaa6e173cb170b
Reviewed-on: https://dart-review.googlesource.com/c/76900
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-10-03 14:56:43 +00:00
Paul Berry 32af1be0a4 Check type arguments against bounds when instantiating a typedef.
Change-Id: I38f390abd2c409694ad15cbc35654ba5dab9b9ce
Reviewed-on: https://dart-review.googlesource.com/77015
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 20:43:19 +00:00
Jenny Messerly 9ad59bada2 [dartdevc] fix #34358, int to double conversion for literals
Also fix #34360 by addressing a few remaining Analyzer issues.

Change-Id: Iac3d9ba72aa370846fced3654a376899b5938152
Reviewed-on: https://dart-review.googlesource.com/76343
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-27 20:15:20 +00:00
Paul Berry d79f7493b3 Test that type parameters of typedefs are properly bounds checked.
I'm trying to fix an analyzer bug where typedef type parameters
weren't checked properly, and it appears that we have no language_2
test cases for it.

Change-Id: I216a337eeaae6ac2008c0c26139797e00099ffcb
Reviewed-on: https://dart-review.googlesource.com/76707
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-27 12:50:05 +00:00
Paul Berry b1a54154f8 Check that implicit type arguments satisfy bounds.
This required adding an implementation of super-bounded types to the
analyzer.

We really could use some more tests to verify that we disallow
super-bounded types in all the appropriate locations, but allow it in
other cases (it seems that there are no language_2 tests to verify
this).  To avoid churn, I'll wait until I have confirmation that my
reasoning is correct in #34583 before submitting test cases.

Fixes #34532.
Fixes #34560.

Change-Id: I3c5def60bcac0d31b56bead31cb1aab445f18e96
Reviewed-on: https://dart-review.googlesource.com/76280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-26 01:12:28 +00:00
Konstantin Shcheglov 9185294e7a Reland: Implement inheritance/override checks from the spec.
Relands https://dart-review.googlesource.com/c/sdk/+/76061
Was reverted in https://dart-review.googlesource.com/c/sdk/+/76301

The difference with the original CL is that we don't look into
superclass and mixins of mixed-in for concrete members. This reduces
the number of errors in Flutter codebase to 1.


R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: I86256b598d116439194cbaf4d09b4f72013d6563
Reviewed-on: https://dart-review.googlesource.com/76340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 18:51:04 +00:00
Konstantin Shcheglov d34337aa2d Ignore noSuchMethod() for the purpose of searching concrete member implementations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33553
Change-Id: Ie597cb4d39ba16e4503503b59d1e5179c594bad5
Reviewed-on: https://dart-review.googlesource.com/76200
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-25 02:37:03 +00:00
Zach Anderson 95d37b0921 Revert "Implement inheritance/override checks from the spec."
This reverts commit 836a1d7a88.

Revert "Don't use ClassElementImpl for now in override checking."

This reverts commit 58e44c1400.

Revert "large_class_declaration_test is slow now."

This reverts commit 56f6c52d58.

Revert "Add regression test for issue 34392."

This reverts commit ef7d144bc7.

Revert "Mixin declarations don't have supertype, fix isMoreSpecificThan()."

This reverts commit 95b8a19a20.

Change-Id: Icda9cf9091ef35acc8fd61ac5dc135b3717eba0a
Reviewed-on: https://dart-review.googlesource.com/76301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-24 21:27:34 +00:00
Konstantin Shcheglov 56f6c52d58 large_class_declaration_test is slow now.
Because of my https://dart-review.googlesource.com/c/sdk/+/76061

R=brianwilkerson@google.com

Change-Id: I2d8654faf247b333303d34d31bc4fef9288a2561
Reviewed-on: https://dart-review.googlesource.com/76261
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-24 19:51:34 +00:00
Konstantin Shcheglov 836a1d7a88 Implement inheritance/override checks from the spec.
This CL starts moving checks from strong-mode specific checker,
and old InheritanceManager into an implementation that is based
on the current spec, and avoids old baggage. It also fixes the issue
we were asked to fix for Dart 2.1.

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: Id5a23c5db7704b2b530bb894ae92628a08eaa70f
Reviewed-on: https://dart-review.googlesource.com/76061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-24 16:28:50 +00:00
Paul Berry ead158ab5d Fix gatherMixinSupertypeConstraints to handle named mixin applications.
In a named mixin application, the superclass doesn't include the last
type appearing in the "with" clause, so that class isn't considered a
superclass constraint.

Fixes some test cases broken by 46e5954b0a.

Change-Id: I2e824d38017fe2c7eaa23e8f185cea07fe2222b7
Reviewed-on: https://dart-review.googlesource.com/75940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-21 16:37:55 +00:00
Paul Berry 46e5954b0a Turn on and fix mixin type inference checks when not in "supermixin" mode.
Now that we have an explicit syntax for mixins that is available all
the time, we have to do mixin inference error checking all the time,
not just when the "--supermixin" flag is supplied.

This required fixing several minor bugs:

- ErrorVerifier._checkForMixinSuperInvokedMembers did not properly
  handle a mixinElement argument that was a ClassElementHandle.

- ErrorVerifier._checkMixinInference wasn't using the actual
  substituted mixin types, causing errors to be wrongly reported when
  a class declaration had multiple inferred mixins (this was the root
  cause of #34404).

- Type names in "with" clauses in the resolved AST weren't properly
  reflecting the mixin type arguments that had been inferred.

Fixes #34404.

Change-Id: Ia773233c66f8d9ab778f207689c73922e9e3a880
Reviewed-on: https://dart-review.googlesource.com/75792
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-21 01:06:25 +00:00
Mike Fairhurst 0ec9945885 Fix #33629 boolean negation of void
Bug: 33629
Change-Id: Ieabd07cd7155b60466bf6873ba8252c9b5cb8d70
Reviewed-on: https://dart-review.googlesource.com/75784
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-09-20 23:58:48 +00:00
Paul Berry 2e3f17fa2b Add support for the new mixin syntax to supertype constraint checking and resynthesis.
Partially addresses #34404.

Change-Id: Ia115647c7e6e15092a7dca55287ff0680b780a97
Reviewed-on: https://dart-review.googlesource.com/75625
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-20 02:34:36 +00:00
Paul Berry 296e4aa7e6 Split mixin_declaration_inference_valid_classes_test.dart into multiple tests.
I will soon start landing fixes to address some (but not necessarily
all) of the test cases in this test, and I want to make sure that my
fixes produce corresponding status file changes, to secure against
possible future regressions.

Change-Id: Iaec11b85a20d670c0702220cadbbdfc51c026d1f
Reviewed-on: https://dart-review.googlesource.com/75624
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-09-20 00:04:42 +00:00
Paul Berry 7763ec3cd1 Surface analyzer toplevel inference limitations as DDC errors.
To avoid causing unrelated tests to start failing, the tests have been
modified to avoid running afoul of the analyzer toplevel inference
limitations.  (Note that we still have adequate test coverage in
pkg/front_end/testcases that the front end isn't subject to these
limitations).

Change-Id: I7b8f84a358d0e8891025b24143117c39d1b7dd69
Reviewed-on: https://dart-review.googlesource.com/75389
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-19 21:01:59 +00:00
Paul Berry cf67e402bd Add test case reproducing issues #34498 and #34500.
Also modify async_backwards_compatibility_1_test so that fixing these
bugs won't cause it to start failing.

Change-Id: I7bb3b9587a0aeea8662df1923034bcb409a29522
Reviewed-on: https://dart-review.googlesource.com/75280
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-19 16:37:15 +00:00
Konstantin Shcheglov 81ce969060 Enable implicit constructors with optional parameters in mixin applications.
The spec changed in https://github.com/dart-lang/sdk/commit/63c6851dd01514e9d9e6cb96da0430e15b66d576

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34375
Change-Id: If7ba66d82fa4127cc6764d93f299790e8a862b42
Reviewed-on: https://dart-review.googlesource.com/75422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-19 16:12:21 +00:00
Paul Berry eb059a76f3 Keep analyzer-specific status entries together in language_2_analyzer.status
Change-Id: Ia7677460a9106b52cae6bde94c959531476e33d2
Reviewed-on: https://dart-review.googlesource.com/75426
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-09-19 14:09:29 +00:00
Daniel Hillerström de984e58cb Type checking for redirecting factories.
Implements static semantics for redirecting factories (c.f. §10.6.2 of
the specification). This CL does not include inference of actual type
arguments on redirectees, that is it does not handle the case where
type arguments have been omitted on the redirectee as in this
following example program:

  class A<T> {
    factory A() = B;
  }
  class B<T> implements A<T> {
    B();
  }

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

Also resolves the second part of
https://github.com/dart-lang/sdk/issues/30579.

Can possibly also close https://github.com/dart-lang/sdk/issues/11578.

Change-Id: I5f1fb60510ba6cdc917321239819c1f817b5b85d
Reviewed-on: https://dart-review.googlesource.com/74580
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-09-19 06:20:20 +00:00
Konstantin Shcheglov a27bafc306 Check that the concrete member in the class has same type as the super-invoked member in the mixin.
R=brianwilkerson@google.com

Change-Id: I985872d2eb5eaf7608b030b9803d664ad0878b04
Reviewed-on: https://dart-review.googlesource.com/75243
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-18 17:06:22 +00:00
Jenny Messerly 0496569f09 implement super mixins in dartdevc and fix a few issues in Analyzer
Fixes #34167. This implements the Dart 2 mixin proposal
(https://goo.gl/KEKQyv) for DDC. When the mixin is applied, a class
is created for the application that extends the correct superclass
and has all of the instance members, so `super` works correctly.

This also fixes a few minor issues in Analyzer's (mostly complete)
implementation:
- InterfaceType.isObject now returns false for Dart 2 mixins.
- Least upper bound calculation recognizes mixins are not Object.
- Interface of the mixin now implements its superclass constraints.
- Mixin superclass constraints are checked against the superclass and
  all previously applied mixins (if any); this keeps it working with
  the subtype fix above, and also prevents a not-yet-applied mixin
  from satisfying the constraint

The language_2/mixin_declaration tests were updated with a few minor
fixes now that we can run Analyzer/dartdevc to test them.

This change implements super mixins for DDC's Kernel backend (DDK)
too. This will be enabled once Kernel adds a flag to recognize which
Class nodes are mixins (vs normal classes).


Change-Id: Ib3c4fcb12de9988345e52d92931196828d8227c3
Reviewed-on: https://dart-review.googlesource.com/74965
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-09-18 03:21:48 +00:00