Commit Graph

544 Commits

Author SHA1 Message Date
Riley Porter cfa35be6f0 [package:js] Added checks for external non-JS members.
Adds static errors in web backends requiring external members to be
annotated with @JS(). Members can be annotated directly, or on the
enclosing class or library.

Also removes duplicate checks in dart2js for non-native external
members that are now covered by the checks on external @JS members.

Change-Id: I2b17456f8f546f80f1ea6a817360c7f4c40f9640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-02-03 02:14:18 +00:00
Mayank Patke ed441e48d0 Update all Slow tests to be Slow, Pass.
Change-Id: I610b272355b045eab80cf941210774fb12d775eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134103
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-01 00:17:42 +00:00
Robert Nystrom fc1b1ecc71 Move files under language_2 into subdirectories.
Change-Id: Idbcc965a27e9ffeedf5e0a1068b019de4193070f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127745
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-12-11 19:18:00 +00:00
Karl Klose 60afc24502 [infra] Convert some multi-tests to the new static error framework
This is the result of running the tool from
https://dart-review.googlesource.com/c/sdk/+/124128 on the
language_2 tests that contain only static multi-test annotations.

Some of the results needed manual editing and in these cases I have
also changed the formatting of the tests.

Change-Id: I4ddd16a2c5d8576adccb0a740cb1d4aabbc001b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126161
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-12-04 13:06:58 +00:00
Kallen Tu ef742aa6f0 [ddk] Modify _isInterfaceSubtype to consider variance annotations during runtime.
Change-Id: Idc1b553d24d76bfe52d51204aae0e0334f210fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121910
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-10-23 21:48:17 +00:00
Mayank Patke 24f45d64c7 Delete language_2/generic_no_such_method_dispatcher_simple_test.
language_2/generic_no_such_method_dispatcher_test works after
https://dart-review.googlesource.com/c/sdk/+/115901, so we can delete this test
now.

Change-Id: Ifb0b32f9afb0d93de3db75f2293f60a1ce485c13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116751
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-12 00:41:39 +00:00
Karl Klose e193f502f9 [infra] Remove non-essential test expectations with comments from devc status files
Change-Id: I7fff65b92b1890ccce80f37afe30a58a8942e956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114854
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2019-09-02 07:04:05 +00:00
Karl Klose 4b19400ba7 [infra] Remove non-essential test expectations from devc status files
Change-Id: If1d4550aab4465fbf2491a4411148d94f6a47273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113987
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2019-08-28 10:10:52 +00:00
Aske Simon Christensen e611357309 [CFE] Error on bitwise or shift operation on a double constant.
Fixes https://github.com/dart-lang/sdk/issues/36823

Change-Id: I9aeb34b9f80261889434f85bf39af3d78a38202e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112391
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-08-16 11:11:27 +00:00
Nicholas Shahan 8c834efae9 [dartdevc] Skip all tests on DDC for extension methods
We expect to turn down DDC in favor of DDK before shipping extension methods so
they will never be implemented.

Change-Id: I4f4ddfbf37ccec965d53b21eac9223e75b87d93c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112420
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-08-08 22:00:22 +00:00
Nicholas Shahan 0ca1582afd Revert "[dartdevc] Temporarily skip const stress tests in DDK"
This reverts commit 8fb4240bcb.

Reason for revert: Fix has been merged.
https://dart-review.googlesource.com/c/sdk/+/109640/16

Original change's description:
> [dartdevc] Temporarily skip const stress tests in DDK
> 
> Revert this change once fixes have landed for DDK.
> 
> Issue: #37523
> Change-Id: I2855c647ceb5b9831466d8da458e6e7bcd810ee9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110543
> Auto-Submit: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>

TBR=vsm@google.com,nshahan@google.com

Change-Id: Iace2084460eb42b0ebe05f72b8511c16fc1b28a4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: #37523
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110600
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-07-25 23:50:46 +00:00
Nicholas Shahan 8fb4240bcb [dartdevc] Temporarily skip const stress tests in DDK
Revert this change once fixes have landed for DDK.

Issue: #37523
Change-Id: I2855c647ceb5b9831466d8da458e6e7bcd810ee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110543
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-07-25 19:01:37 +00:00
Stephen Adams e4eea58ac9 [gardening] Update language_2/constructor12_test for strong checking
Change-Id: I1f0f121af9d22ccb2345c8da9070d352ade742f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108907
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-12 14:46:13 +00:00
Stephen Adams ed764e5688 [gardening] Delete legacy parser_quirks_test
This is a test of keep-on-truckin' behaviour that is now a static
error.

Should we delete it?

Change-Id: Ia8702f46d8d343941ed002f42e0a217485e53fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108761
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-11 17:45:48 +00:00
Vyacheslav Egorov 5479175012 Remove incorrect test.
Symbol constructor can't be used to create symbols for private names.

Closes https://github.com/dart-lang/sdk/issues/34377
Closes https://github.com/dart-lang/sdk/issues/30848
https://github.com/dart-lang/sdk/issues/36433
https://github.com/dart-lang/sdk/issues/34904

Change-Id: Ibe551c43a9209e1f483cea8178665890d52799aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108416
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-07-09 17:32:29 +00:00
Stephen Adams 738d9f9666 Avoid non-web integer literal in language2/list_test
Change-Id: I926dc7b9e9eabd098c4561ea95e1e3568522902f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107922
Commit-Queue: Stephen Adams <sra@google.com>
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-07-04 01:01:26 +00:00
Stephen Adams 1f02c10b9a Update language_2/const_map4_test for type inference
Change-Id: Id81d974b0889e7c469ed40c85955f9b18265c634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107927
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-02 19:23:18 +00:00
Stephen Adams 822de210b5 fix branch_canonicalization_test
Change-Id: Icd26e9edf3dbf513c614743a97c696ed88df00db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107570
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-07-02 06:15:02 +00:00
Nate Bosch 2b56c2c58a Normalize status files
Run `pkg/status_file/bin/normalize.dart` across all status files.

This should solve most presubmit warnings about "existing and possibly
new status file issues".

There are remaining issues in pkg/front_end/testcases/strong.status and
pkg/front_end/testcases/text_serialization.status which will need to be
fixed manually.

Change-Id: Iceae8992c4907442481590d75c1b0a84ce29521b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106726
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-06-19 23:04:01 +00:00
Paul Berry d81783ff5f Begin writing language_2 tests for NNBD.
These tests validate simple uses of trailing `?` syntax, and exercise
the ambiguous cases mentioned in the draft spec.

Change-Id: If2526c7f4c898495d667d7e16a2005bd8432f8df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99183
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-12 12:42:48 +00:00
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
Nicholas Shahan 2ee8bb87e4 Remove control flow collections test skips for all platforms
Issue: #36005
Change-Id: Ibbc1f22c8e4dad9b5a72f97001638772622b74ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98430
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-04-02 19:17:47 +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
Erik Ernst 2805a376b2 Added tests for superinterface variance constraints
Change-Id: Ib9e3fbe577c2ba49d1f8f535cbd295ec7fed8d24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97111
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-03-21 09:34:00 +00:00
Kevin Millikin c9e9b76d4d Skip control-flow-collections tests on all runtimes
This feature is under development in the front end.  Testing it on the
runtimes leads to numerous spurious status changes.  Skip the tests
for now.  The intent is that when a backend change causes a test to
start passing, then that test will be un-skipped.

Change-Id: I6c8c1f45315607039240c3edc61ba8340ae9cda0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96902
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-03-14 13:09:07 +00:00
Aske Simon Christensen 99093c0610 [fasta] Required but not inferred constant context.
Add a new kind of constant context in the body builder for expressions
that must be constant but where constness is not inferred.

This context is used for parameter default values and initializing
expressions for non-final fields in classes containing at least one
const constructor.

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

Change-Id: I200ca88586b19335b185dad0839dfad4eef1f75f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/93520
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-03-05 09:23:57 +00:00
Jenny Messerly 36ab8b18ea [dartdevc] implement set literal and enable-experiments support
Change-Id: Ibc45b1b1792d62a8f176e6c2f2f5c1e3134942f1
Reviewed-on: https://dart-review.googlesource.com/c/88400
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-01-04 22:08:54 +00:00
Dmitry Stefantsov e98701ea33 [fasta] Allow const constructors in mixin applications
Closes #33644, closes #33645, closes #32223.

Bug: http://dartbug.com/33644
Bug: http://dartbug.com/33645
Bug: http://dartbug.com/32223
Change-Id: Ia30efb8f450e62bfeb65c8b7fd7e23871ef0e87e
Reviewed-on: https://dart-review.googlesource.com/c/68368
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-12-14 12:37:30 +00:00
Jenny Messerly f68ae70e8e [dartdevc] ensure all throws are wrapped in JS Error (#33331)
This improves the default JS display of exceptions/errors from DDC
compiled code. This gives a better "default" experience if JS code
(or a JS engine, like browers/Node.js) ends up catching Dart exceptions.

Change-Id: Ib2dda6eee710f8b536d5ed7223e0101310a137b3
Reviewed-on: https://dart-review.googlesource.com/c/84446
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-12-13 22:44:17 +00:00
Lasse Reichstein Holst Nielsen a957c4351a Add more tests for async*/await-for operations.
Change-Id: Icadb9edfe2ef40aff3808295685f961897d63c9a
Reviewed-on: https://dart-review.googlesource.com/c/86181
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-12-10 14:38:34 +00:00
Paul Berry 670f9ab49b Merge commit '65401da92251a7318e3264b816ce0c4e14701751' into analyzer 2018-12-04 15:38:21 -08:00
William Hesse c71a5279c5 Revert "Add more tests for async*/await-for operations."
This reverts commit a0d576e6cd.

Reason for revert: Turned many buildbot builders red. Use the "Choose tryjobs" button to run more configurations on this type of commit.  Use the "tools/bots/approve_results.dart" tool to update expectations for builders running the new workflow

Original change's description:
> Add more tests for async*/await-for operations.
> 
> Change-Id: I2c8ffb8a6738b8dee43cfdf85be0c54d2735b6cc
> Reviewed-on: https://dart-review.googlesource.com/c/85391
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=lrn@google.com,leafp@google.com

Change-Id: I81830c3fc565b62e98538feba9bd64c6dd11dd51
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/86023
Reviewed-by: William Hesse <whesse@google.com>
2018-12-04 20:09:46 +00:00
Jenny Messerly d3c3341b8a [dartdevc] fix conditional imports in kernel backend
Change-Id: I694b67624dff65099ca8cb8147d2b56a3532cd6c
Reviewed-on: https://dart-review.googlesource.com/c/85880
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-12-04 18:39:46 +00:00
Paul Berry 0a4873bb35 Merge commit '191a09f540ac0516c4088fb8454c693743be8b3f' into analyzer 2018-12-04 09:41:55 -08:00
Lasse Reichstein Holst Nielsen a0d576e6cd Add more tests for async*/await-for operations.
Change-Id: I2c8ffb8a6738b8dee43cfdf85be0c54d2735b6cc
Reviewed-on: https://dart-review.googlesource.com/c/85391
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-12-04 13:58:03 +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 be7983e148 Merge commit 'c24073f442e7c7b789894ad8210aff8accc36702' into analyzer 2018-11-07 07:37:12 -08:00
Jenny Messerly fceae8524d [dartdevc] fix #34531, optimize covariance checks in the kernel backend
This is similar to the analyzer backend's optimization for fields, but
it also supports private methods and accessors.

Also fixes #34769, checks were missing for explicit covariant fields
and those are now generated (this is for fields of the form
`covariant SomeType fieldName`--implicitly covariant fields in generic
classes were already checked correctly).

Change-Id: I5ce3ed7944bdc5a9799c731c5f95e199b461b079
Reviewed-on: https://dart-review.googlesource.com/c/79432
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2018-11-07 01:56:35 +00:00
Paul Berry 4b1870307d Merge commit '8d12600b16bcc9ae113c47fb6a3d5b68b1388c5c' into analyzer 2018-11-06 14:59:15 -08:00
Paul Berry 5dc2156ba4 Cherry-pick be815e1a86 to analyzer branch
Original commit message:

    [dartdevc] fix #35013, move DDC off Analyzer task model

    The new file pkg/dev_compiler/lib/src/analyzer/driver.dart handles
    building the linked summary for a build unit, and then is capable of
    doing analysis using LibraryAnalyzer.

    The algorithm is very similar to analyzer_cli's build mode. The
    biggest difference is that `dartdevc` has existing support for
    discovering source files from the explicit source list (rather than
    requiring every source to be listed on the command line). We don't want
    to break that support, so there's a bit of logic to follow imports,
    exports, and parts.

    After the linked summary is produced, DDC gets the analysis results
    (errors and resolved AST) for each library, and compiles it into a JS
    module.

Change-Id: I8d1855c27f9976cad6fd9ccb567b75a613e6048c
Reviewed-on: https://dart-review.googlesource.com/c/83060
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-11-06 21:43:42 +00: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
Jenny Messerly be815e1a86 [dartdevc] fix #35013, move DDC off Analyzer task model
The new file pkg/dev_compiler/lib/src/analyzer/driver.dart handles
building the linked summary for a build unit, and then is capable of
doing analysis using LibraryAnalyzer.

The algorithm is very similar to analyzer_cli's build mode. The
biggest difference is that `dartdevc` has existing support for
discovering source files from the explicit source list (rather than
requiring every source to be listed on the command line). We don't want
to break that support, so there's a bit of logic to follow imports,
exports, and parts.

After the linked summary is produced, DDC gets the analysis results
(errors and resolved AST) for each library, and compiles it into a JS
module.

Change-Id: I7bf1ce1eca73fd036002e498de5924c488b534dc
Reviewed-on: https://dart-review.googlesource.com/c/82469
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-11-06 00:52:24 +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 a4c73e3739 Merge commit '5226b5c307b04da8df96924a46780eb31a5bd75e' into analyzer 2018-11-02 06:06:20 -07:00
Kevin Millikin ad2db25ce6 Do not add constructors to mixin declarations
Mixin declarations cannot be instantiated or extended, so they should
not have constructors.  Adding a compiler-generated constructor causes
us to try to add an invocation of the default superclass constructor.
Because the superclass constraint is encoded as a superclass this can
cause a spurious error that is impossible to fix.

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

Change-Id: Ia8f99d00b1a5b042da233d54f3cc1f0c6345e779
Reviewed-on: https://dart-review.googlesource.com/c/82447
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-02 10:45:10 +00:00
Jens Johansen 993f7260c1 Labeled variable declarations shouldn't introduce a new scope
Before, e.g.
```
main() {
  L: var x, y;
  x = 42;
  y = x;
}
```

would produce something like
```
static method main() → dynamic {
  {
    dynamic x;
    dynamic y;
  }
  x = 42;
  y = x;
}
```

i.e., the variable declaration was in another scope, and their usage
isn't legal.

This CL fixes that by either
a) (the normal case) not wrapping it --- the label is not used anyway.
b) (the case that cannot happen) put a label on the first part so the
   output would be something like
```
  L: dynamic x;
  dynamic y;
  x = 42;
  y = x;
```

Fixes #34943.

Change-Id: I24132665dab53fb8fb024f73dd11e0d1f1945812
Reviewed-on: https://dart-review.googlesource.com/c/82063
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-02 10:20:42 +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