Commit Graph

1972 Commits

Author SHA1 Message Date
Johnni Winther fb3143f684 [cfe] Handle this.length in constant context
Closes #43290

Change-Id: I099b0185c37bd824518628d95e1eda8b897b3e73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161502
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-03 06:51:44 +00:00
Johnni Winther 7130dd4d3d [cfe] Report error on non-void setter return type
This CL also adds fileUri/charOffset to all TypeBuilder's and renames
Void/FutureOr/Never/Dynamic/BuiltInTypeBuilder to *TypeDeclarationBuilder
so match their relation to TypeBuilder/TypeDeclarationBuilder.

Closes #42962

Change-Id: Iee5102134574d24f748103282a37bb9a85a0ac2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161165
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-09-02 12:43:12 +00:00
Jens Johansen 8805a3f9c7 [CFE] Mark incremental_load_from_dill/strongmode_mixins_2 as crash in status file
I think currently it's marked in the test system (which is why it is not
sad on the bots), but that doesn't help us when running the
incremental_load_from_dill_suite.dart locally.

Change-Id: I0b92b2b30ddb606a96632d6f34ee4c2767cfbeb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161173
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-09-01 14:19:49 +00:00
Jens Johansen 8030a3f68e [CFE] Enable textual outline modelling in incremental compiler
This CL enables textual outline modelling in the incremental compiler,
meaning that the textual outlines created (and compared) to figure out
if we can do a "minimal invalidation" (with the experiment enabled)
is "modelled", i.e. have members, classes etc sorted so that re-ordering
things in a file generally doesn't cause a "transitive invalidation".

Change-Id: I9daddf2bd34e4c2e17b42a5e356033816d05b359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161172
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-09-01 14:14:59 +00:00
Johnni Winther 6dc5a58252 [cfe] Report errors on non-nullable optional parameters without default value in factory constructors
Closes #43276

Change-Id: I50f68e910a5e79fd978f10cad3651bfe0aec535f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161169
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-01 14:05:19 +00:00
Johnni Winther 082295a61e [cfe] Support lowering of static fields with initializers
This adds support lowering the encoding of top-level/static fields
with initializers as if they were marked as late fields. This ensures
that LateInitialization is thrown if final fields are written to during
initialization.

Closes #42956

Change-Id: I488fdddd87ebd935a0cdaf82a724e9b87d5f91ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160724
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-01 07:20:58 +00:00
Robert Nystrom 88b77feb73 Roll dart_style 1.3.7 into the SDK.
The main reason is that this adds better help text when run from
`dart format`. But it includes a couple of other changes and fixes:

* Don't crash when non-ASCII whitespace is trimmed.
* Split all conditional expressions (`?:`) when they are nested.
* Handle `external` and `abstract` fields and variables.

Change-Id: I59326e693bfe538013cd23b58924461f60e8e908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160981
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-08-31 18:07:44 +00:00
jlcontreras 70fd140a9d [cfe] Implements addConstructor of value class transformation
Change-Id: I991c82693a6a3a44061efa7703fa89bd94f858b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158280
Commit-Queue: Javier López-Contreras <jlcontreras@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-08-31 13:24:38 +00:00
Johnni Winther a1baa373ec [cfe] Rename link and test options
Rename test.options files and TestOptions to folder.options and FolderOptions,
respectively. Rename link.options files and LinkDependencyOptions to
test.options and TestOptions.

This is to better reflect the current usage of these options.

Change-Id: Ibd3c49fa5bd1c9ce8a9eb5910417c12cd45845d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160723
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-28 11:14:38 +00:00
Johnni Winther 9be824c3ef [cfe] Provide missing forEffect argument
Closes #43218

Change-Id: Id1f4d872cc77d2b7b8ae76b0cafd7bf5f5297949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160722
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-28 09:57:28 +00:00
Jens Johansen 97e981eb85 [CFE] Textual outline refactorings + ability to sort show/hide on import/export
Change-Id: I9d5f0e39f64036d474ec904993c44b1a242b2f4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-28 09:43:58 +00:00
Johnni Winther 6079377dc1 [cfe] Ensure default type on all declarations
Closes #43202

Change-Id: I3b8f6e24436aac7cdcdd2e1cce1448a1bcc122de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160521
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-08-27 18:21:57 +00:00
Clement Skau 4db081545e Revert "[VM] Fixes yield* exception handling in sync*."
This reverts commit 358aee331b.

Reason for revert: Appears to break service/async_generator_breakpoint_test

Original change's description:
> [VM] Fixes yield* exception handling in sync*.
> 
> This adds a mechanism similar to that used in async functions where
> exceptions are caught in the synthetic code and passed into the
> generated body to be rethrow'n.
> This ensures the exception is throw'n from the same place as the
> original yield*, as per the spec.
> 
> Bug: https://github.com/dart-lang/sdk/issues/42466
> Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,cskau@google.com

Change-Id: I9df83543d41d4260e91e4a7fb8df7c2762b92429
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/42466
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160101
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-08-25 14:08:42 +00:00
Johnni Winther f61cab8a27 [cfe] Reland: Support superscope search in late initializer
From https://github.com/dart-lang/sdk/pull/43156

The reland allows this access in assert initializers.

Closes #43137

Change-Id: Ie557108a57612f0d2e838ff9420f1bb6ce0a37f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160069
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 13:23:09 +00:00
Clement Skau 358aee331b [VM] Fixes yield* exception handling in sync*.
This adds a mechanism similar to that used in async functions where
exceptions are caught in the synthetic code and passed into the
generated body to be rethrow'n.
This ensures the exception is throw'n from the same place as the
original yield*, as per the spec.

Bug: https://github.com/dart-lang/sdk/issues/42466
Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-08-25 12:40:49 +00:00
Johnni Winther 4996d11854 [cfe] Handle experiment release version in CFE.
Closes #43033

Change-Id: I6752d19e56586e4072de1c0f4a7cc31ca3500691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160062
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 12:32:50 +00:00
Johnni Winther 44e466c7fb [cfe] Handle dead code in Expression.getStaticTypeAsInstanceOf
Related to https://github.com/flutter/flutter/issues/64155

Change-Id: I71f1310a00a2b0cfbfb263361293bb442826199c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160061
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 10:19:10 +00:00
Johnni Winther a3e001d0f1 Revert "[cfe] Support superscope search in late initializer"
This reverts commit 991f877e53.

Reason for revert: Breaks code using implicit this in assert initializer (which probably is illegal, though).

Original change's description:
> [cfe] Support superscope search in late initializer
> 
> From https://github.com/dart-lang/sdk/pull/43156
> 
> Closes #43137
> 
> Change-Id: I1ab972b93ee1d7b957c48d4097ff71fc1f1c5453
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159842
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

TBR=dmitryas@google.com,johnniwinther@google.com

Change-Id: I32ac4b4311aae3bebe31060af5e481c60d052aeb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160067
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 09:56:41 +00:00
Johnni Winther 991f877e53 [cfe] Support superscope search in late initializer
From https://github.com/dart-lang/sdk/pull/43156

Closes #43137

Change-Id: I1ab972b93ee1d7b957c48d4097ff71fc1f1c5453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159842
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 07:46:29 +00:00
Jens Johansen f190a4ae27 [CFE] Change sorting in textual outline
This CL basically change two things about the sorting:
* Entities are not sorted according to metadata. Metadata just follows
  along. Before "@a class B {}" would come before "class A {}" because
  "@" comes before "c". Now "class A {}" comes first because "A" < "B".
* Sorting happens on a token level, i.e. "F<int>" will now come before
  "F2<int>" because "F" < "F2" whereas before it was the other way
  around because "F2" < "F<" (because "2" < "<").

None of it really matters as long as sorting is done the same way when
comparing the outlines.
Doing it this way makes it faster and actually brings the runtime
(in benchmarks) less than the old (now deleted) textual outline.

Change-Id: Ib1d887ab0c14519316c8e9a3da38f0dd49b4104f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159041
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-21 09:55:00 +00:00
Jens Johansen f5b1063f86 [CFE] Implement typeVariables and type for DillTypeAliasBuilder
This CL lets DillTypeAliasBuilder implement typeVariables and type
and adds a few test that crashed before.

The tests crashed similar to
https://github.com/dart-lang/sdk/issues/43084
so it's assumed that the issue is fixed too.

Change-Id: I735a5d56cf2073be2a1c5f1fa142d98420ef9d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-20 11:36:38 +00:00
Jens Johansen 65968a481b [kernel] ast-to-text shows combinators for imports/exports
Change-Id: If153dded362eb1fe5f4c52a92206ff8e86579c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159248
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-20 10:24:48 +00:00
Johnni Winther de224ac5f4 [cfe] Update ast-to-text to include member signature origins
Change-Id: I46e7fe831bc5e87981e78537b37565c62646210f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157961
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-17 13:41:49 +00:00
Jens Johansen ddb88ca455 [CFE] Fix textual outline bot failure caused by landing race
Change-Id: I50e5c317bd01cd07291b016c57343a8baa177e09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158843
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-17 09:18:45 +00:00
Jens Johansen a12b14ed83 [CFE] Add option to mark unknown textual outline chunks
Change-Id: Idcb1596b62e9b6450f08212429b2cc1d5f06d19d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158552
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 04bc03e4ad [CFE] Textual outline knows about (and can thus sort) imports and exports
Before this CL the textual outline didn't know about imports and exports
and thus couldn't sort them.

This CL makes it know about them and allows imports and exports to be
sorted internally, but not mix with other stuff (e.g. imports should be
placed after "foo() {}" just because "f" comes before "i", but putting
"import 'a.dart'" before "import 'b.dart'" is OK.

This CL does not sort the hide and show entries.

Change-Id: Ic640cdaa98ac3562f8b36b21180a26584cb6d205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158551
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 66f11394f3 [CFE] Textual outline knows about (and can thus sort) named mixin applications
Before this CL the textual outline didn't know about named mixin
applications which caused it to insert "fences", i.e. splaces it
wouldn't sort across.

So for instance
class E {}
class D {}
class C<T> = Object with A<Function(T)>;
class B {}
class A {}

would not be sorted fully because class C is a named mixin application,
something it didn't know about, and it would only allow stuff on either
side to be sorted. So the sorted output would have been

class D {}
class E {}
class C<T> = Object with A<Function(T)>;
class A {}
class B {}

With this change it knows about it and the output would now thus be
class A {}
class B {}
class C<T> = Object with A<Function(T)>;
class D {}
class E {}

Change-Id: I97b28706732582d0c37f1b2c052b9f6eaf862a5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158550
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 42214d2eb0 [CFE] Textual outline doesn't add line-break for empty classes
E.g. before this change an empty class output would have been
class Foo {
}

now instead it becomes
class Foo {}

this matches what the formatter does.

Change-Id: Id08edc5259bae00deff9a66b4ae745f21c192358
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158549
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 330c7500d4 [CFE] Textual outline doesn't add space for empty methods
E.g. before this change a procedure output would have been
foo() { }

now instead it becomes
foo() {}

this matches what the formatter does.

Change-Id: Ieb538d61e527cbec26d1d65ed6de349311dd0163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158548
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-17 08:16:18 +00:00
Jens Johansen 8bca93872a [parser] Better error message for annotations on type arguments
This CL changes the message given in the situation identified in
https://github.com/dart-lang/sdk/issues/22314

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

Change-Id: Ibd47dd419d52673ae0d9e32039e0a635c1e09543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158388
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-17 07:43:52 +00:00
Johnni Winther d267906184 [cfe] Ensure that noSuchMethod forwarders are not marked as member signatures
Change-Id: Id8a093db8d757b08cee97d9c7de1baa452531bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158547
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-14 15:30:24 +00:00
Johnni Winther 4b2f375402 [cfe] Ensure that forwarding stub are distinct from member signatures
Change-Id: Ie5c37b55e0d636a1ab70cb77d816b977b5351451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158385
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-14 11:12:40 +00:00
Johnni Winther f8e7e64fd6 [cfe] Handle constant constructor invocations in Widget factory constructors
The widget transformer would try to pass on the location injected
parameter in the factory constructor when calling constructors of its
own kind in constructor body. For instance

  class Foo extends Widget {
    factory Foo() => new Foo.internal();
    Foo.internal();
  }

would be transformed into

  class Foo extends Widget {
    factory Foo({Location loc}) => new Foo.internal(loc: loc);
    Foo.internal({Location loc}) : super(loc);
  }

This doesn't work if the constructor invocation is constant. For
instance:

  class Foo extends Widget {
    factory Foo() => const Foo.internal();
    const Foo.internal();
  }

which would be transformed into

  class Foo extends Widget {
    factory Foo({Location loc}) => const Foo.internal(loc: loc);
    const Foo.internal({Location loc}) : super(loc);
  }

Here the reading of the injected factory parameter [loc] is not a
valid constant, leading to a compile-time error during constant
evaluation.

To handle this, const constructor invocations within factories do
not pass on the location from the surrounding constructor but
uses their own. For instance:

  class Foo extends Widget {
    factory Foo() => const Foo.internal();
    Foo.internal();
  }

will be transformed into

  class Foo extends Widget {
    factory Foo({Location loc})
      => const Foo.internal(loc: const Location());
    Foo.internal({Location loc}) : super(loc);
  }

This does mean that these constant widgets will all have a
location based on the factory constructor declaration and _not_
one per invocation of the factory constructor.

Related to https://github.com/flutter/flutter/issues/63335

Change-Id: Ie3300d3ba81324d5fbd7fb6ab72b9d83d7afcf22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158395
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-14 10:15:12 +00:00
Jens Johansen 75fe329369 [CFE] Make sure textual outline suite is run on bots
This CL:
* Adds the textual outline suite to the suite runner run by the bots,
  hopefully ensuring that we won't forget about them in the future;
* Adds the missing textual outlines and status entries to make the
  textual_outline suite pass.

Change-Id: I0434b6a8e19019bbae7457ea738a13f2623f0c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-14 09:39:00 +00:00
Johnni Winther e597681d22 [cfe] Update messages for failures to opt in to non-nullable experiment
Change-Id: I16d71feeb51a7eee13048195898adfe7bf5761d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157482
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-14 09:01:07 +00:00
Johnni Winther bc73bb1b2c [cfe] Remove inheritanceConflictCache
Change-Id: I91619b9292a6dd20f657aea9cf8e642ce21ffda5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158381
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-13 11:14:34 +00:00
Jens Johansen 7e42cbf582 [parser] Change recovery of multiple extends with comma
E.g. class Foo extends Bar, Baz {} would before have parsed weirdly,
but it will parse as you'd (probably) expect with an error saying
you cannot do that. For now at least both CFE and Analyzer will
pretend like you just specified the first one but I suppose Analyzer
could for instance use the extra information to propose converting
other ones to implements clauses or similar.

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

Change-Id: I180cdd8ab07143dd74fd21c9976ec2a46c428d8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158261
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-13 08:49:53 +00:00
Alexander Markov 4ef577d50e [vm/tfa] add map/set factory specializer to support infer metatype
https://github.com/dart-lang/sdk/issues/37861

Closes https://github.com/dart-lang/sdk/pull/42943
https://github.com/dart-lang/sdk/pull/42943

GitOrigin-RevId: 508f49256f1916e862c6d6f48efc77406d0b63de
Change-Id: Iec6786bcd4fa09704c533cbff6957130aa524ada
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157240
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-08-12 19:20:38 +00:00
jlcontreras ee1ee7ee15 [cfe] Add mixin tests and runtime tests for the value class feature
Change naming value classes -> value class

Change-Id: Ifab5e0be8b816192b5716fd3433afb721bd9394c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156881
Commit-Queue: Javier López-Contreras <jlcontreras@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-08-12 16:46:17 +00:00
Johnni Winther d5def62c9c [cfe] Insert forward stub only in the first class that needs it
This avoids adding forwarding stubs on all subsequent subclasses by
using the result of the superclass member computation in subclass
member computation.

Change-Id: Id9ae4a8e7b0fbfe90c863580f056bf9d6266220f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157322
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-12 14:40:05 +00:00
Jens Johansen 4c0cab024e [parser] No longer support ?.[ syntax
Update CFE tests (and a few analyzer tests) to match the new world
of the syntax being unsupported.

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

Change-Id: I71bc973f36dfb978ddb825edb68530d8e260a58a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157980
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-11 08:09:59 +00:00
Johnni Winther 9a2a3aae14 [front-end] fix bug in BodyBuilder
https://github.com/dart-lang/sdk/issues/42997

@mraleph

> Also, how to construct tests that generate AmbiguousBuilder and catch error?

Closes https://github.com/dart-lang/sdk/pull/42998
https://github.com/dart-lang/sdk/pull/42998

GitOrigin-RevId: be1aae61495cabcb1a7e8cffff47c18574f97d2e
Change-Id: Icdfb8f5acf7db8475a9500596b995354d2e83b3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-11 07:26:02 +00:00
Johnni Winther 3059f64647 [cfe] Use mutual subtyping to check valid mixin applications
Related to flutter/flutter#63029

Change-Id: I492b348c414c76b5fda497614c733730d02bccfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157981
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-11 07:24:39 +00:00
Jens Johansen 714ee1cd48 [CFE] Reproduction for flutter issue #63029
Change-Id: I9df135af44fe023e4795f0a042f1bc1297ace8d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157499
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-07 14:26:24 +00:00
Johnni Winther b9c5118c73 [cfe] Don't mark external methods as abstract
Closes #31233
Related to flutter/flutter#62887

Change-Id: I96e5a1b8045f75f1ad02fb47e5e41fe402dc3dc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157481
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-08-06 16:29:09 +00:00
Jens Johansen 8cb0afa882 [CFE] Example of an added stub or not
This CL does three things:
* It adds a test that shows how a stub is added if it compiles all
  "user libraries" from source, but not when it loads some libraries
  from a dill. This is bad and can lead to leaks (and possibly other
  things).
* It adds the transformation phase to the tests using the link option
  for the linked component. This is needed to avoid a potential crash
  (assert error) in the mixin transformation triggered by the new test
  added above.
* It adds the possibility to create a non-linked compilation in a
  testcase directory with a link.options file by naming the file
  "<whatever>.no_link.dart". This way one can have two expect files
  close together that shows differences between using linked
  dependencies and not without too much duplicated test code.

Change-Id: I170c66fb3e0d4d1263217d64234dc0e88388747d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156912
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-05 06:27:50 +00:00
Johnni Winther ad9c73cb32 [cfe] Use promoted type as type context in variable assignment
Closes #41698

Change-Id: Iea87c770b560f6f72f9382f06615d99ad2be0c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155764
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-08-03 10:37:41 +00:00
Dmitry Stefantsov 7831716efd [cfe] Use Object? as top type in NNBD greatest closure algorithm
Closes #42579, #42580.

Bug: https://github.com/dart-lang/sdk/issues/42579
Bug: https://github.com/dart-lang/sdk/issues/42580
Change-Id: I90a519b4d580d139bbccfcefd8553ec68aac71ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156240
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-07-30 15:49:59 +00:00
Johnni Winther c50cbe9ed0 [cfe] Don't use type context for local function inference when type parameters mismatch
Change-Id: Ia6f697fa25ea83a7518ba63ad083b3493d35b2a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156460
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-30 13:18:28 +00:00
jlcontreras 17be0b4edf Fix nnbd flag bug in tests for Value Classes feature.
Change-Id: I1a092c951d529c1db395a3bb03e887a3a33a96e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156194
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-29 15:07:09 +00:00