Commit Graph

2317 Commits

Author SHA1 Message Date
Jenny Messerly 64b6d713e3 [dartdevc] enable super mixin support in Kernel backend
Change-Id: If2a1c4ec8328080a890e7f22b657b19af4fe53ae
Reviewed-on: https://dart-review.googlesource.com/75791
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-09-20 23:59:18 +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
Jens Johansen 0315707dec Add 'set' case to type_variable_conflict_test
Also align.

Issue #31851.

Change-Id: I0578719471c5cbe4c1d038498d55129ffc36a767
Reviewed-on: https://dart-review.googlesource.com/73361
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-09-20 09:49:58 +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
Aart Bik a890d95a26 [vm/compiler] Avoid !(x>y) -> x<=y on fp operands.
Rationale:
Two closely related bugs found with fuzz testing!
NaN must be preserved. We may improve comparisons
on fp in the long run, but this CL avoids the
incorrect optimization.

Bug: https://github.com/dart-lang/sdk/issues/34467
     https://github.com/dart-lang/sdk/issues/34466

Change-Id: Ie3667632eea2583098cf5f86a723ab4304d5d6c5
Reviewed-on: https://dart-review.googlesource.com/75242
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-19 19:58:09 +00:00
Alexander Markov bc79674bc1 [vm/aot] Fix inferred type of implicitly initialized final fields
Bug: https://github.com/flutter/flutter/issues/21957
Change-Id: I63e1b6787761aaf7acfda653775518755ffcb0b5
Reviewed-on: https://dart-review.googlesource.com/75382
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-19 17:54:57 +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 0a5d7b866d Update status files after de984e58.
The bleeding edge console revealed that status files for
dartk-checked-linux-release-x64 configuration needed to be updated.

Change-Id: I7015427f55436947aebd019212765c5f3937f846
Reviewed-on: https://dart-review.googlesource.com/75440
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
2018-09-19 07:36:36 +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
Régis Crelier 30f0026022 [VM runtime] Fix type test: C is a subtype of C<FutureOr> (fixes #34482).
In other words, C<dynamic> <: C<FutureOr<dynamic>>,
because dynamic <: FutureOr<dynamic>.

Add regression test.

Change-Id: I64bcb3b6926143d3176f0afcd1f28d30582309fa
Reviewed-on: https://dart-review.googlesource.com/75400
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-19 01:35:40 +00:00
Konstantin Shcheglov bbe83465ea Test that type of the ListLiteral with two different enums is inferred.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I7b0980008fe58a1b430f989af72fb04c0fb07c8c
Reviewed-on: https://dart-review.googlesource.com/75385
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-19 00:37:59 +00:00
Alexander Markov 37b41bd317 Update status files after d4148159cc
There are several crashes on kernel-precomp bots related to the new
tests. As front-end does not issue a compile-time error,
AOT transformations such as constant evaluation are not skipped and
may crash on incorrect hierarchy.

Stack trace:

Change-Id: Ieaf789535eb4c59a3cc4f2f3437b2b41b9e506f4
Reviewed-on: https://dart-review.googlesource.com/75401
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-09-18 22:19:10 +00:00
Leaf Petersen d4148159cc Initial valid inference checks
Change-Id: I75c3f3a4072aeaa6f27d399196ba3c57e79fecbb
Reviewed-on: https://dart-review.googlesource.com/74017
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-18 19:59:26 +00:00
Aart Bik 4eb879133a Revert "[vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y"
This reverts commit 0471d7e3a1.

Reason for revert: crashes are happening on the Nullable test
                   I will fix this in the follow-up CL that was
                   already pending

Original change's description:
> [vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y
> 
> Rationale:
> Bug found with fuzz testing! For FP, behavior around
> NaN must be preserved.
> 
> Bug: https://github.com/dart-lang/sdk/issues/34466
> 
> 
> Change-Id: Ia4ed831fc130e58318edb838bd46e30b93f62ff3
> Reviewed-on: https://dart-review.googlesource.com/75208
> Commit-Queue: Aart Bik <ajcbik@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,sjindel@google.com,asiva@google.com,ajcbik@google.com

Change-Id: Ie2e233a612cbe00478475d086eec87ff2b3d652b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/34466
Reviewed-on: https://dart-review.googlesource.com/75383
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-09-18 19:20:33 +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
Johnni Winther 2da165a62d Stop compilation early on CFE compile-time errors
Change-Id: Ie93af5880bbd0b9f0c72aa6c1832550bf9025595
Reviewed-on: https://dart-review.googlesource.com/75160
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-09-18 06:50:55 +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
Aart Bik 0471d7e3a1 [vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y
Rationale:
Bug found with fuzz testing! For FP, behavior around
NaN must be preserved.

Bug: https://github.com/dart-lang/sdk/issues/34466


Change-Id: Ia4ed831fc130e58318edb838bd46e30b93f62ff3
Reviewed-on: https://dart-review.googlesource.com/75208
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-17 23:39:12 +00:00
Paul Berry 5c54401d74 Add test case reproducing issue #34488.
Change-Id: I0dea1cb682b607b324703303922efdfe098fa28f
Reviewed-on: https://dart-review.googlesource.com/75131
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-17 23:18:08 +00:00
Erik Ernst f5ec9b0554 This CL changes some status comments, but also points out an issue.
The point is that #32782 requests a fix such that
`typedef F1 = void Function(int)` and `typedef void F2(int)`
satisfy that `F1 == F2` evaluates to true. This is marked
'p3-low' for the common front end but 'p1-high' for DDC.

It seems likely to me that this could create the situation where
code is developed using DDC, is working, and then fails upon
deployment using the vm. Also, there is a single case where
`dart2js` fails in the associated `type_alias_equality_test.dart`,
so deployment on the web would also fail upon deployment, though
only in some of the cases.

However, with some input from Aske I concluded that the situation
might have arisen because there _is_ no work to do for this in the
common front end, because it will be handled by the backend (which
also explains why `dart2js` has it almost right).

This CL is just introducing a tiny change: It changes the issue
indicated for all VM related failures in said test to point to
#32783, which is presumably the right issue for backend work.

Apart from that, I've added you, the reviewers, in order to make
sure that the relevant people get this heads up. We may then decide
to land this CL, change the priority on #31359, do nothing, or
whatever turns out to be the right response. ;-)

Change-Id: I92672547d7fe795e877604c0da1e0e4579e4e04a
Reviewed-on: https://dart-review.googlesource.com/74403
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-09-14 08:56:22 +00:00
Bob Nystrom a16c7d899a Fix typo in mixin test.
Change-Id: I1c6300dfa250ef0b9ea84e9bd5fd233eb5827464
Reviewed-on: https://dart-review.googlesource.com/74960
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-14 05:18:39 +00:00
Mike Fairhurst ca8e5baccd Fix #34443 fix tests that will fail with int2double
Bug: 34443
Change-Id: I2b0edb9f6f1e642c92a656301f9b8a85c3e4658c
Reviewed-on: https://dart-review.googlesource.com/74669
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-13 22:32:54 +00:00
Mike Fairhurst 3cf61aee33 Fix #34444, rounded doubles in double literals test
Bug: 34444
Change-Id: Ie818cde6ec1cbca38d50ace43336ae3e7ea2a750
Reviewed-on: https://dart-review.googlesource.com/74663
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-09-13 19:30:06 +00:00
Mike Fairhurst 4ee66c9708 Const evaluation for int2double
Change-Id: I4673ab47d9dfcb8de62a5190a6dd2b9c79ef1d19
Reviewed-on: https://dart-review.googlesource.com/74496
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-13 00:02:54 +00:00
Konstantin Shcheglov 2ede4c7543 Downgrade WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR to warning.
Per https://github.com/dart-lang/sdk/issues/34403#issuecomment-420465838
request.

R=brianwilkerson@google.com

Change-Id: I9a2c319d2262aacf14bfc180d59d16db3f199a2a
Reviewed-on: https://dart-review.googlesource.com/74560
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-12 19:11:26 +00:00
Konstantin Shcheglov b7de316b3d Fix for checking implemented general interfaces for mixins.
R=brianwilkerson@google.com

Change-Id: I8e430471c5a5b544c1c9d323376a92d125c3d81b
Reviewed-on: https://dart-review.googlesource.com/74660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-12 19:07:34 +00:00
Konstantin Shcheglov f89053aecc Report ABSTRACT_SUPER_MEMBER_REFERENCE as error.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33662
Change-Id: Ic80386c20acd2cd1ceebeb90fbb1d6e18982b024
Reviewed-on: https://dart-review.googlesource.com/74499
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-12 17:07:18 +00:00
Lasse R.H. Nielsen df38f8a0e2 Add missing import in implicit_double_context_test.
Fixes #34442.

Bug: http://dartbug.com/34442
Change-Id: Ia59411c7c213d1c7181b663b765e05814b5c09cf
Reviewed-on: https://dart-review.googlesource.com/74622
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-09-12 12:42:55 +00:00
Jens Johansen 5bcc80439f Fasta: Don't crash on on raw generic type cycles
...in type variable bounds with typedefs.

This is the Fasta fix for #33479.

Change-Id: Id3c45891364d390a37424efbcfdb4254bb2f8c48
Reviewed-on: https://dart-review.googlesource.com/73860
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-09-12 12:37:02 +00:00
Lasse R.H. Nielsen 16abf01f26 Add two more tests for integer double literals.
Change-Id: I81f5a13136ab114113df0f3d8335d24050c11590
Reviewed-on: https://dart-review.googlesource.com/74402
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-09-12 08:21:02 +00:00
Mike Fairhurst 8860fad862 Triage analyzer status files
Change-Id: I5f6f5e232a084db1004c99bfcef45795c5bed4d4
Reviewed-on: https://dart-review.googlesource.com/73682
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-09-12 00:29:50 +00:00
Kevin Millikin c0a94ded80 Mark two more app_jitk test failures
Mark the runtime failures as well as the compile-time failures.

Change-Id: I6b36dc9cb695238f7c89b62ed198261f9ec5fc32
Reviewed-on: https://dart-review.googlesource.com/74495
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-09-11 23:13:46 +00:00
Mike Fairhurst 6784fb596f First wave of int2double -- accept doubles as ints except const
Change-Id: I79661b8cf6e1395302b03f1bd3d0260225ffc5e4
Reviewed-on: https://dart-review.googlesource.com/73841
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 22:00:48 +00:00
Kevin Millikin 6bf26ce713 Add status file entries for compiler app_jitk
Mixin declaration tests fail on this configuration (in the same way as
dartk, dartkb, and dartkp).

Change-Id: I06c3aa6f05b147fb2f69d1e2247af3094b1cbf2e
Reviewed-on: https://dart-review.googlesource.com/74483
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-09-11 21:18:56 +00:00
Kevin Millikin 2b296a0671 Enable mixin declaration syntax in Fasta
This enables mixin declarations for the Dart VM by parsing them into
class declarations.

Change-Id: Ic792009bc450d7c887f2e9962040ffad807881eb
Reviewed-on: https://dart-review.googlesource.com/74480
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-09-11 18:05:52 +00:00
Aske Simon Christensen f30543218c GitHub ludo
Change-Id: I03ee56a35dffba9d7d9d4e01872871612b4fbf31
Reviewed-on: https://dart-review.googlesource.com/74420
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-09-11 12:26:33 +00:00
Lasse R.H. Nielsen d6bec62322 Add tests for implicit conversion of integer literals to double values in a double context.
Planned for Dart 2.1.

Change-Id: I0cc7c6f4ea654cbb66b1542b0bc6e0c32728be12
Reviewed-on: https://dart-review.googlesource.com/47880
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-09-11 11:50:44 +00:00
Lasse Reichstein Holst Nielsen 9ab03ce3a3 Remove spurious full stops after "compile-time error"
Change-Id: Ia8d99c2f4de70480c449aa72fde637f07d401288
Reviewed-on: https://dart-review.googlesource.com/74120
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-11 11:36:22 +00:00
Martin Kustermann 609d2770be Reland "[VM] Add new SymbolConstant to package:kernel/ast.dart"
The canonicalization of symbols needs to take library privacy into
account. Since the Symbol class itself only has a [_name] field but does
not reference in which library the symbol came from, the [_name] must be
mangled.

Mangling is done by backends and so we make a new [SymbolConstant] which
the backends can desugar by doing appropriate mangling and construction
of a [Symbol] instance.

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

Change-Id: I2e13288483c35f875d39eefdb73677b2cc03527a
Reviewed-on: https://dart-review.googlesource.com/74360
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-09-11 09:29:01 +00:00
Konstantin Shcheglov 0eee800e1b Report INCONSISTENT_METHOD_INHERITANCE for mixins.
R=brianwilkerson@google.com

Change-Id: I4bfcbccd20049d80deaca346cabf580bdbcaf266
Reviewed-on: https://dart-review.googlesource.com/74320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-10 23:47:44 +00:00
Kevin Millikin cbfc78f5b2 Parse mixin declarations as if they were classes
In Fasta's outline builder, parse mixin declarations as if they were
the corresponding class declaration:

mixin M<T0,...,Ti> on S0,S1,...,Sj implement I0,...,Ik {...}

is parsed as if it were:

class M<T0,...,Ti> extends S0 with S1,...,Sj implements I0,...,Ik {
  ...
}

This supports the syntax and should automatically provide an
implementation of the runtime semantics on the VM.  Not all of the
required static checks are implemented in the front end.

Change-Id: Ice65e93446222484272f8f7db0de2d18c352f56b
Reviewed-on: https://dart-review.googlesource.com/73760
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-09-10 20:40:45 +00:00
Alexander Aprelev d97823b704 Revert "[VM] Add new SymbolConstant to package:kernel/ast.dart"
This reverts commit ef72098353 as it broke
buildbot on CQ.

Change-Id: If9d19a9393157078d0e0890b92a418ba5ced42c6
Reviewed-on: https://dart-review.googlesource.com/74281
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-10 20:40:43 +00:00
Konstantin Shcheglov b6c98976d5 Report CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE for mixins.
R=brianwilkerson@google.com

Change-Id: I513d1026793829a3df7ad46ab40c9c4ddeb379be
Reviewed-on: https://dart-review.googlesource.com/74263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 20:30:23 +00:00
Konstantin Shcheglov 3346632ad3 Report CompileTimeErrorCode.EXTENDS_NON_CLASS for mixins.
I'm also renaming an error to MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE,
because the spec says that `on` clause uses interfaces, not classes.

R=brianwilkerson@google.com

Change-Id: I561fd5605b66cf5a6e870c037ac16c43fc81b403
Reviewed-on: https://dart-review.googlesource.com/74260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 18:11:00 +00:00
Martin Kustermann ef72098353 [VM] Add new SymbolConstant to package:kernel/ast.dart
The canonicalization of symbols needs to take library privacy into
account. Since the Symbol class itself only has a [_name] field but does
not reference in which library the symbol came from, the [_name] must be
mangled.

Mangling is done by backends and so we make a new [SymbolConstant] which
the backends can desugar by doing appropriate mangling and construction
of a [Symbol] instance.

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

Change-Id: I5ddb5331ce79a0b942807929d4b8f1050a9899e7
Reviewed-on: https://dart-review.googlesource.com/73883
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-10 15:31:09 +00:00
Konstantin Shcheglov 9e3bcc4cec Report MIXIN_INSTANTIATE when a mixin is instantiated.
R=brianwilkerson@google.com

Change-Id: Ia19d69bd7f0212bcdfb37f228046c727a36d62e3
Reviewed-on: https://dart-review.googlesource.com/74042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-09 17:04:48 +00:00