Commit Graph

1431 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen f4cadd5a5a Retired inference-using-bounds and wildcard-variables experiments.
Change-Id: I5dcc0c7d2b148eb88e6382118d6fc8ee4c9a9489
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407022
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-02-19 05:25:10 -08:00
Kallen Tu ef2dcd5f48 [parser] Initial parsing of dot shorthands.
Doing some initial work for parsing dot shorthands.

The listeners in the CFE and analyzer will report an extra error if the experiment is not turned on. The compilation should still fail and produce errors, but it won't crash.

If you turn on the experiment, the parsing will crash, but I'd like to get this in so I can modularly work on the CFE and analyzer separately.

Bug: https://github.com/dart-lang/sdk/issues/59758, https://github.com/dart-lang/sdk/issues/59835
Change-Id: I262b0bd5cffc8e5e04ac79c76454b6e355779ade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409540
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-02-18 12:45:53 -08:00
Johnni Winther d3f28d77d1 [cfe] Support parts with imports/parts
This is a part of the enhanced-parts feature needed for further progress on the Builder model migration where patch libraries should be handled as patch parts.

Change-Id: I253b471df56ce383eaf5de18b3287ec3cc161005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409700
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-02-17 03:40:08 -08:00
Paul Berry d3de420bf8 Add a custom lint to sanity check the analyzer public API.
The new lint, called `analyzer_public_api`, verifies that the analyzer
public API satisfies the following properties:

- No method, function, getter, setter, or supertype in the public API
  refers to a non-public type.

- No `export` declaration in the public API shows a non-public name.

- No declaration in the public API has a name ending in `Impl`.

- No file in the public API has a `part` declaration that points to a
  file that's not in the public API. (If it did, then the other checks
  could be circumvented.)

A new annotation is added, `@AnalyzerPublicApi()`, allowing
declarations in `package:analyzer/src` or
`package:_fe_analyzer_shared/src` to be marked as part of the analyzer
public API. This is necessary because some parts of the analyzer
public API need to be declared elsewhere and then exported by the
analyzer.

A few lint violations have been ignored using `ignore:` comments. I
will try to clean these up in follow-up CLs.

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

Bug: https://github.com/dart-lang/sdk/issues/60058
Change-Id: I0047a73dec8a29e2ffe03dd3a90f7e41ca2e27b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-02-14 05:24:22 -08:00
FMorschel 2eec09dcd4 [DAS] Makes EXTENSION_DECLARES_INSTANCE_FIELD trigger on all field names
R=jensj@google.com, paulberry@google.com

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

Change-Id: Ic4b41973d0d74d809d813ba57b85f50fab4c9a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407080
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-11 03:15:31 -08:00
Paul Berry 274f5639f7 [Flow analysis] Remove PropertyNotPromoted.staticType.
This field was only used to populate expectation strings in "id"
tests; it did not affect any user-visible behavior of the analyzer or
CFE.

Including information in "id" tests that doesn't affect any
user-visible behavior isn't helpful. Removing this field will enable
some upcoming flow analysis refactoring work (I intend to remove the
`ExpressionInfo._type` field, replacing its remaining usages with a
more reliable mechanism).

Change-Id: Id4c6593fae4ef25b8c21f0625e6c1f9eaa766e17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406403
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-02-08 16:51:15 -08:00
Kallen Tu 89e545c5cc [dot-shorthands][co19] Rename enum-shorthands flag to dot-shorthands (and roll co19 to b14b080)
We've decided to rename enum shorthands to dot shorthands. It describes the entire feature better. It's not only for enum values. We'll update the experiment name before the implementation goes in, that way our users can use a flag that matches the actual feature name.

Additionally, roll co19 to b14b0802e696a60c79b00d0f052e26fb986f0faf so we can avoid an infra failure with co19 using what's now an unknown feature flag (enum-shorthands).

2025-02-06 sgrekhov22@gmail.com Fixes dart-lang/co19#3067. Rename the static access shorthand feature experiment flag (dart-lang/co19#3068)

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try
Bug: https://github.com/dart-lang/sdk/issues/57037
Change-Id: I031e3bce8166145b24dbb77acf259d78e6e00f0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407603
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2025-02-07 07:38:32 -08:00
Johnni Winther 7c22f942aa [_fe_analyzer_shared] Remove macro tests and helpers
These are no longer used.

TEST=removed

Change-Id: Ibf5b2de9d1b550c21873b48111161366deb2ddc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407980
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
2025-02-05 03:59:31 -08:00
Jens Johansen ca16a4271c [scanner] Replace KeywordState
As bechmarked with the AOT compiles of `scanner_benchmark.dart`
called with
`pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart --bytes`:

```
    N           Min           Max        Median           Avg        Stddev
x  25     138.56434     144.23326     142.64174     142.51626     1.2207074
+  25     148.45681     157.02163     156.44878     155.88958     1.7051997
Difference at 95.0% confidence
        13.3733 +/- 0.843454
        9.38372% +/- 0.59183%
        (Student's t, pooled s = 1.48287)
```

And compiling the CFE from December with the CFE, statistics on 25 runs
each, run with `--cache --silent` (so 2 x 50 runs each) (in AOT mode):

```
msec task-clock:u: -0.9684% +/- 0.3536% (-58.65 +/- 21.42)
page-faults:u: -0.1051% +/- 0.0818% (-125.36 +/- 97.49)
cycles:u: -1.0001% +/- 0.3225% (-252905081.28 +/- 81554799.59)
instructions:u: -0.5915% +/- 0.0007% (-181426590.44 +/- 209346.28)
seconds time elapsed: -0.9657% +/- 0.3525% (-0.06 +/- 0.02)
seconds user: -1.1336% +/- 0.4333% (-0.07 +/- 0.03)

msec task-clock:u: -1.3115% +/- 0.3364% (-79.48 +/- 20.39)
page-faults:u: -0.1900% +/- 0.0774% (-226.72 +/- 92.37)
L1-icache-load-misses: 0.4990% +/- 0.2072% (2422435.64 +/- 1006075.94)
LLC-loads: -2.3896% +/- 0.1707% (-1179245.64 +/- 84228.28)
LLC-load-misses: -1.9244% +/- 0.2041% (-639169.84 +/- 67791.64)
seconds time elapsed: -1.3128% +/- 0.3374% (-0.08 +/- 0.02)
seconds user: -1.3311% +/- 0.4183% (-0.08 +/- 0.02)
```

Combined the 3 CLs ending here gives this result when compiling
the CFE from December with the CFE, statistics on 25 runs each,
run with `--cache --silent` (so 2 x 50 runs each) (in AOT mode):

```
msec task-clock:u: -1.7681% +/- 0.3034% (-106.37 +/- 18.25)
page-faults:u: -0.1834% +/- 0.0863% (-218.80 +/- 103.00)
cycles:u: -1.8163% +/- 0.2668% (-456090610.64 +/- 66985831.74)
instructions:u: -1.1851% +/- 0.0007% (-365653999.24 +/- 220539.29)
branch-misses:u: -2.8468% +/- 1.0580% (-2611811.72 +/- 970666.69)
seconds time elapsed: -1.7687% +/- 0.3026% (-0.11 +/- 0.02)
seconds user: -1.9723% +/- 0.4480% (-0.11 +/- 0.03)

msec task-clock:u: -1.7787% +/- 0.3042% (-107.07 +/- 18.31)
page-faults:u: -0.2413% +/- 0.1050% (-288.12 +/- 125.39)
L1-icache-load-misses: 0.5218% +/- 0.1599% (2523027.12 +/- 773363.93)
LLC-loads: -2.2917% +/- 0.1613% (-1125147.16 +/- 79181.20)
LLC-load-misses: -2.0256% +/- 0.2667% (-670484.64 +/- 88293.18)
seconds time elapsed: -1.7793% +/- 0.3036% (-0.11 +/- 0.02)
seconds user: -1.7392% +/- 0.3752% (-0.10 +/- 0.02)
```

And for the scanner benchmark, in AOT mode, called with
`pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart --bytes` for bytes per microsecond:

```
    N           Min           Max        Median           Avg        Stddev
x  25     114.87867     117.70322     117.10106        116.85    0.67188864
+  25       153.512     156.99315     156.38671     155.95981    0.98376554
Difference at 95.0% confidence
        39.1098 +/- 0.479146
        33.4701% +/- 0.410053%
        (Student's t, pooled s = 0.842386)
```

Change-Id: Ica6d47d92ab0fb4c3a06aa6686b8c71f52a6aef8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407480
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-02-05 03:12:26 -08:00
Jens Johansen 49a9d42cfc [scanner] Ask VM to inline Token._setCommentParent
From the scanner benchmark with --bytes:

```
    N           Min           Max        Median           Avg        Stddev
x  25     135.49248     140.11327     137.90404     137.70731     1.1732525
+  25     135.55161     143.54553     141.81997     141.37336     1.8048844
Difference at 95.0% confidence
        3.66606 +/- 0.865817
        2.66221% +/- 0.628737%
        (Student's t, pooled s = 1.52219)
```

Change-Id: Ia69010d6215f59242b7f4e91d1af295cf4db1775
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407421
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-05 03:04:50 -08:00
Jens Johansen 95265c319c [scanner] Optimize scanning of identifiers, comments, spaces etc.
In bytes per microsecond, statistics on 25 runs each of an AOT compile
scanner_benchmarker run with
`pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart --bytes`:

```
    N           Min           Max        Median           Avg        Stddev
x  25     116.01859     118.24483     117.63414     117.41239     0.6246963
+  25      136.5563     139.73077     138.82117     138.72373    0.75137577
Difference at 95.0% confidence
        21.3113 +/- 0.393007
        18.1508% +/- 0.334724%
        (Student's t, pooled s = 0.690945)
```

With `--string`:

```
    N           Min           Max        Median           Avg        Stddev
x  25     104.77452     118.00444     115.83707     115.04005     2.8653416
+  25      120.1637     125.80937     123.84278     123.88533     1.2858698
Difference at 95.0% confidence
        8.84528 +/- 1.26317
        7.68887% +/- 1.09802%
        (Student's t, pooled s = 2.22077)
```

And running it through the benchmarker
(`pkg/front_end/tool/benchmarker.dart --cache --silent
--iterations=25`):

`--bytes`:

```
msec task-clock:u: -15.4177% +/- 0.3838% (-515.18 +/- 12.83)
cycles:u: -15.5303% +/- 0.3716% (-2263042219.68 +/- 54143984.97)
instructions:u: -11.8786% +/- 0.0000% (-3721971162.16 +/- 292.14)
branch-misses:u: -13.0375% +/- 0.8048% (-10550278.80 +/- 651299.13)
seconds time elapsed: -15.4170% +/- 0.3820% (-0.52 +/- 0.01)
seconds user: -15.4936% +/- 0.3859% (-0.51 +/- 0.01)

msec task-clock:u: -15.1724% +/- 0.3173% (-505.72 +/- 10.58)
L1-icache-load-misses: 42.3794% +/- 6.4906% (1901929.52 +/- 291287.30)
LLC-loads: 3.2837% +/- 0.7535% (40264.52 +/- 9239.86)
LLC-load-misses: -2.2808% +/- 1.3789% (-3647.96 +/- 2205.39)
seconds time elapsed: -15.1722% +/- 0.3201% (-0.51 +/- 0.01)
seconds user: -15.1811% +/- 0.3196% (-0.50 +/- 0.01)
```

`--string`:

```
msec task-clock:u: -6.2018% +/- 0.3384% (-207.18 +/- 11.31)
cycles:u: -6.2315% +/- 0.3257% (-907517140.20 +/- 47432247.03)
instructions:u: -7.2693% +/- 0.0000% (-2325765423.72 +/- 491.22)
branch-misses:u: -2.6467% +/- 0.6289% (-2198552.96 +/- 522409.28)
seconds time elapsed: -6.1995% +/- 0.3378% (-0.21 +/- 0.01)
seconds user: -6.2612% +/- 0.3705% (-0.21 +/- 0.01)

msec task-clock:u: -6.1645% +/- 0.4224% (-206.18 +/- 14.13)
L1-icache-load-misses: 40.5703% +/- 6.3952% (1945020.52 +/- 306599.42)
LLC-loads: 1.5464% +/- 0.8925% (20130.04 +/- 11618.51)
seconds time elapsed: -6.1656% +/- 0.4197% (-0.21 +/- 0.01)
seconds user: -6.1980% +/- 0.4240% (-0.21 +/- 0.01)
```

And compiling the CFE from December with the CFE, statistics on 50 runs
each, again run with `--cache --silent` (so 2 x 50 runs each):

```
msec task-clock:u: -0.7401% +/- 0.1900% (-45.01 +/- 11.56)
cycles:u: -0.7971% +/- 0.1917% (-202488820.10 +/- 48684812.34)
instructions:u: -0.5975% +/- 0.0004% (-184367556.38 +/- 137673.23)
branch-misses:u: -2.9490% +/- 0.8146% (-2788427.60 +/- 770259.65)
seconds time elapsed: -0.7428% +/- 0.1901% (-0.05 +/- 0.01)
seconds user: -0.7148% +/- 0.2895% (-0.04 +/- 0.02)

L1-icache-load-misses: 0.1974% +/- 0.1457% (954253.92 +/- 704297.81)
LLC-loads: 0.1988% +/- 0.1244% (97594.22 +/- 61084.80)
```

Change-Id: I0550596f5320a1ff00d85765c121d012f55bec61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-05 03:04:24 -08:00
Johnni Winther f797e5f138 [cfe] Remove MixinApplicationBuilder
Change-Id: I2780f63c1d63655cc23d44426f29d5d9a040c5f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406841
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-01-30 05:48:42 -08:00
Mohamed Abdelaal 9b7bb9df90 Fix "the the" typo
Closes https://github.com/dart-lang/sdk/pull/59926

GitOrigin-RevId: cb37bca473b0c177b876a0f4e75858cd1862e699
Change-Id: I6827241b22e99db455945afcdfbaee0450999ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404923
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-01-21 14:08:20 -08:00
Johnni Winther 7f46b33019 [_fe_analyzer_shared] Return the shortest witness
This updates the exhaustiveness checking to return the shortest witness when no more cases match a value.

This also fixes an exponential case that occurred when checking for reachability.

Closes #59927

Change-Id: I82ede75113ca5d361875620287f7ce3c5fb2f5d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405120
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-01-21 00:24:33 -08:00
Chloe Stefantsova dcd410efd4 [analyzer][cfe] Remove TypeStructure variable from shared classes
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Ia70f2afd321e9b4a4762b6ed860611dee1399d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404622
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-01-20 01:58:43 -08:00
Paul Berry 240d87e142 [_fe_analyzer_shared] Change signature of extension type constructors.
The constructors for `SharedTypeView<TypeStructure>` and
`SharedTypeSchemaView<TypeStructure>` are changed so that they accept
`TypeStructure` rather than `SharedTypeStructure<TypeStructure>`.

For context, I'm currently in the middle of migrating the analyzer so
that it passes a type argument of `TypeImpl` instead of `DartType`
when using generic types that accept a `TypeStructure` type
argument. The purpose of this change is to ensure that when a given
use of `SharedTypeView` or `SharedTypeSchemaView` has its type
argument changed to `TypeImpl`, the type checker will ensure that the
corresponding constructor argument satisfies `TypeImpl`.

There is no change to runtime behavior.

Change-Id: I34d540312b567e390e7dfa535806051e0d5f2868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404900
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-01-17 07:03:41 -08:00
Alexander Thomas b59c3e22ef [release] Bump version on main to 3.8
Change-Id: Ia56ca5673096bd59423b808f585902af42dc2e5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404620
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
2025-01-16 02:56:26 -08:00
Jens Johansen c075d939e0 [parser/scanner] Remove ScannerConfig enableNonNullable
Change-Id: If6bfbb65a02ac1a4f5708ab9e8c4d66c19ecff86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403984
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-13 00:32:35 -08:00
Jens Johansen 5dfce919cd [parser/scanner] Remove ScannerConfig enableExtensionMethods
Extension methods can no longer be disabled. This CL removes the option
from the scanner config and the parser related specific recovery.
It also removes any specific (triggered) test of the functionality.
A follow-up CL will do the same for NNBD.

Change-Id: Ia385008e5ed1333fb37697b8fe424b8759bce198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403581
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-13 00:32:25 -08:00
Paul Berry 9a472930e5 [_fe_analyzer_shared] Renames to prepare for analyzer refactoring.
The following shared getters are renamed so that their names are
distinct from the corresponding getters in the analyzer:

- `SharedFunctionTypeStructure.positionalParameterTypes` is renamed to
  `positionalParameterTypesShared` to be distinct from the analyzer's
  public getter `FunctionType.positionalParameterTypes`.*

- `SharedFunctionTypeStructure.returnType` is renamed to
  `returnTypeShared` to be distinct from the analyzer's public getter
  `FunctionType.returnType`.

- `SharedNamedFunctionParameterStructure.type` is renamed to
  `typeShared` to be distinct from the analyzer's public getter
  `FormalParameterElement.type`.

- `SharedNamedTypeStructure.type` is renamed to `typeShared` to be
  distinct from the analyzer's public getter
  `RecordTypeNamedField.type`.

- `SharedRecordTypeStructure.positionalTypes` is renamed to
  `positionalTypesShared` to be distinct from the analyzer's public
  getter `RecordType.positionalTypes`.*

- `SharedRecordTypeStructure.sortedNamedTypes` is renamed to
  `sortedNamedTypesShared` to be distinct from the analyzer's public
  getter `RecordType.sortedNamedTypes`.

- `SharedTypeParameterStructure.bound` is renamed to `boundShared` to
  be distinct from the analyzer's public getter
  `TypeParameterElement2.bound`.

*Note that `FunctionType.positionalParameterTypes`,
 `RecordType.positionalTypes`, and `RecordType.sortedNamedTypes` were
 unintentionally exposed as part of the analyzer's public API. In a
 previous CL I marked them as deprecated.

These renames pave the way for changing the analyzer's `DartType`
class so that it implements `SharedTypeStructure<TypeImpl>` rather
than `SharedTypeStructure<DartType>` (without the renames, the public
getters mentioned above would all have to be changed to have type
`TypeImpl`, and that in turn would expose `TypeImpl` through the
analyzer public API, which we don't want to do).

Once `DartType` implements `SharedTypeStructure<TypeImpl>`, that will
allow all the other uses of `SharedTypeStructure<DartType>` in the
analyzer to be gradually migrated to
`SharedTypeStructure<TypeImpl>`. Once that is done, `DartType` can be
changed so that it no longer implements
`SharedTypeStructure<TypeImpl>` at all (`TypeImpl` will implement
`SharedTypeStructure<TypeImpl> instead). This will free us up to make
future changes to the `SharedTypeStructure` base class without
inadvertently exposing those changes through the analyzer public API.

This is part of a larger arc of work to change the analyzer's use of
the shared code so that the type parameters it supplies are not part
of the analyzer public API. See
https://github.com/dart-lang/sdk/issues/59763.

Change-Id: I0686fdeae304f8948484516f0249841b79e7da6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403625
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-01-10 14:32:47 -08:00
Chloe Stefantsova f49c620ab3 [analyzer][cfe] Share inference-using-bounds routines
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: I12282c2492ed9f1220b47fcf8b0d73c93bbfc432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401660
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-01-09 03:13:06 -08:00
Jens Johansen ad562fdbbe [parser] Rename accidentally committed 'allowLazyFoo' parameter
In https://dart-review.googlesource.com/c/sdk/+/382162 I accidentally
left in the debug-named version of a parameter. This renames it to not
be called foo.

Change-Id: Ib9421b4a5ee63b9b6296a09d14b4ab73ae414742
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403586
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-01-09 00:33:12 -08:00
Sam Rawlins 292987fb1d analyzer: Support doc-imports with prefixes
Change-Id: I91f7b992e6425a6bf76ee32a68e09b2b03ee4447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-06 06:47:19 -08:00
Paul Berry a8b8df2e45 [_fe_analyzer_shared] Renames to prepare for analyzer refactoring.
The following shared getters are renamed so that their names are
distinct from the corresponding getters in the analyzer:

- `SharedFunctionTypeStructure.sortedNamedParameters` is renamed to
  `sortedNamedParametersShared` to be distinct from the analyzer's
  getter `FunctionTypeImpl.sortedNamedParameters`.

- `SharedFunctionTypeStructure.typeFormals` is renamed to
  `typeParametersShared` to be distinct from the analyzer's getter
  `FunctionTypeImpl.typeFormals`.

- `SharedNamedFunctionParameterStructure.name` is renamed to
  `nameShared` to be distinct from the analyzer's getter
  `ParameterElement.name`.

- `SharedNamedTypeStructure.name` is renamed to `nameShared` to be
  distinct from the analyzer's getter `RecordTypeNamedFieldImpl.name`.

These renames pave the way for switching the analyzer's use of these
shared types over to the new element model. They're necessary because
when the analyzer switches over to the new element model:

- `FunctionTypeImpl.sortedNamedParameters` will no longer have the
  correct type to override
  `SharedFunctionTypeStructure.sortedNamedParameters`; instead, it
  will be necessary to convert each named parameter to a corresponding
  element in the new element model (`FormalParameterElementImpl` or
  `ParameterMember`).

- `FunctionTypeImpl.typeFormals` will no longer have the correct type
  to override `SharedFunctionTypeStructure.typeParametersShared`;
  instead, it will be necessary to use
  `FunctionTypeImpl.typeParameters` (which is a list of
  new element model type parameters).

- `ParameterElementMixin` will no longer implement
  `SharedNamedFunctionParameterStructure`; instead,
  `FormalParameterElementImpl` and `ParameterMember` (which are
  classes in the new element model) will implement it. The class
  `FormalParameterElementImpl` deliberately doesn't have a `name`
  getter; instead it has a `name3` getter, with slightly different
  semantics (it returns `null` rather than the empty string when there
  is no name).

Change-Id: I629e45b6fc588e6a86f7590aab853064e31ab661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-01-06 06:12:22 -08:00
Paul Berry 70c0a2e5f9 Sort declarations in type_analyzer_operations.dart.
Change-Id: I7ac3d89425db12a94dfde7f0ad49120f3442cd85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402360
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-12-30 08:33:39 -08:00
Halil Durmus 1a8afa6bbf [vm/ffi] Allow omitting native types for @Native functions
This change simplifies working with `@Native`-annotated functions by allowing the native type to be omitted when it can be inferred from the Dart function's signature. While this was previously supported for `@Native` fields, it now applies to functions as well.

Before this change, you needed to specify the native type explicitly:
```
@Native<Void Function(Pointer)>()
external void free(Pointer p);
```

After this change, the native type can now be omitted if it's clear from the Dart signature:
```
@Native()
external void free(Pointer p);
```

TEST=tests/ffi/native_assets/*

CoreLibraryReviewExempt: VM only
Closes: https://github.com/dart-lang/sdk/issues/54810
Change-Id: Ied5407fcd2f49d85284cb7817f0c8cad2a73626b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400840
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-12-20 02:05:40 -08:00
Paul Berry fcb5e06fdd [analyzer] use PromotableElement2 to interface to shared analysis code.
Change the analyzer's use of the following shared classes and mixins
to supply `PromotableElement2` instead of `PromotableElement` as the
type parameter that represents promotable variables:
- `AssignedVariables`
- `AssignedVariablesForTesting`
- `CaseHeadOrDefaultInfo`
- `DemoteViaExplicitWrite`
- `FlowAnalysis`
- `GeneratedTypeConstraint`
- `MatchContext`
- `MergedTypeConstraint`
- `NonPromotionReasonVisitor`
- `SwitchExpressionMemberInfo`
- `SwitchStatementMemberInfo`
- `TypeAnalyzer`
- `TypeAnalyzerErrors`
- `TypeAnalyzerOperations`
- `TypeAnalyzerOperationsMixin`
- `TypeConstraintFromArgument`
- `TypeConstraintFromExtendsClause`
- `TypeConstraintFromFunctionContext`
- `TypeConstraintFromReturnType`
- `TypeConstraintGenerator`
- `TypeConstraintGeneratorMixin`
- `TypeConstraintOrigin`
- `UnknownTypeConstraintOrigin`
- `VariableBinder`
- `VariableBinderErrors`

This ensures that all references to variables within the shared code
are using the new analyzer element model.

As a result of this type change, a lot of analyzer code that
interfaces with shared logic needs to change to use the new element
model.

Also, a few additional members need to be added to
`BindPatternVariableElementImpl2`, `JoinPatternVariableElementImpl2`,
`LocalVariableElementImpl2`, and `PatternVariableElementImpl2` to
allow members of the underlying `_wrappedElement` to be accessed.

Change-Id: Ie925eeb82523c769c4d869a37551718f75d334ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-12-18 13:40:48 -08:00
Lasse R.H. Nielsen fe0552db17 Retire digit-separators experiment in SDK 3.7.
Change-Id: I6a37665fa76059f665b52844e4a9784dca6224b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400381
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-12-18 10:57:18 -08:00
Paul Berry 574e54db67 [_fe_analyzer_shared] Add shared logic to support null-shorting.
This change introduces a new mixin, `NullShortingMixin`, with a type
parameter `Guard` for the data structure used by the client to desugar
null-aware accesses. The mixin maintains a stack of these guards, and
provides methods that the client can use to manipulate the stack:

- `startNullShorting` adds an entry to the stack; it should be called
  when the client encounters the `?.` part of a null-aware expression.

It also provides two hooks that the client can override if desired:

- `handleNullShortingStep`, called whenever an entry is removed from
  the stack; this will let the CFE know when it should de-sugar a null
  short using a "let" expression.

- `handleNullShortingFinished`, called whenever a sequence of entries
  is removed from the stack; this will let the analyzer know when it
  should change the static type of an expression as a result of
  null-shorting.

Also, a new optional parameter, `continueNullShorting`, is added to
`TypeAnalyzer.analyzeExpression`. If this parameter is `false` (the
default value), then any null shorting that is started during analysis
of the expression (due to the client calling `startNullShorting`) will
be terminated before returning. If it is `true`, then null shorting
won't be terminated, so it will extend to the containing
expression. For expression types that are able to extend null shorting
that appears in their target subexpression (e.g., method calls and
property accesses), the `visit` or `analyze` method should pass
`false` for this parameter when making a recursive call to analyze the
target.

Finally, the `NullShortingMixin` has a getter `nullShortingDepth`,
that `TypeAnalyzer.analyzeExpression` uses to determine when null
shorting should be terminated, and a method `finishNullShorting`, that
actually does the work of terminating null shorting. In principle,
clients don't need to invoke these parts of the `NullShortingMixin`
API. However, since the CFE doesn't always use
`TypeAnalyzer.analyzeExpression` (favoring its own internal methods
`InferenceVisitorImpl.inferExpression` and
`InferenceVisitorImpl.inferNullAwareExpression`), the CFE will need to
use them.

The "mini_ast" tests of flow analysis formerly used a method called
`nullAwareAccess` to exercise the flow analysis effects of null-aware
constructs. This was hacky and confusing, and is now unnecessary,
since the shared infrastructure now fully supports null-shorting. So
this method has been removed and replaced by the ability to mark a
method invocation or property access as null-aware.

This change only builds the infrastructure for shared analysis of
null-shorting; the analyzer and CFE still handle null shorting on
their own. In follow-up CLs I will change the analyzer and CFE to make
use of the shared mechanism.

Change-Id: Ide25a915c4d06eab751b87c1c2745749d23a8114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399480
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-12-10 19:07:18 +00:00
Paul Berry cc6ef3afdc [analyzer] Avoid call from one visit method to another in resolver.
When `PrefixedIdentifierResolver.resolve` rewrites a prefixed
identifier expression to a property access (which it does when the
prefix is an expression having record type), instead of making a call
from `ResolverVisitor.visitPropertyAccess` to
`ResolverVisitor.visitPropertyAccess` to resolve the rewritten
expression, use a private helper method for both code paths.

This ensures that all `visit` methods in the `ResolverVisitor` are
called solely from `ExpressionImpl.accept` or from
`ExpressionImpl.resolveExpression` (at least as far as expressions are
concerned). This will pave the way for a follow-up CL, in which I will
make sure that all expression resolution is done through the
`TypeAnalyzer.analyzeExpression` method. That will in turn allow the
analyzer to use the shared implementation of null-shorting introduced
in https://dart-review.googlesource.com/c/sdk/+/399480.

Change-Id: I782e10be2f58fdc0991b6d917f81bedd856485a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399627
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-12-09 23:30:17 +00:00
Halil Durmus bb483f34a3 [vm/ffi] Allow configuring the variable dimension of variable-length arrays
TEST=tests/ffi/*

CoreLibraryReviewExempt: VM only
Closes: https://github.com/dart-lang/sdk/issues/52366
Change-Id: I545a323f48d955b591cedf2dae7106d9004242e2
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-arm64-try,vm-fuchsia-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-arm64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398621
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-12-09 22:02:56 +00:00
Jens Johansen e30f60791a [parser] Don't use the next token as the end on handleSend
Change-Id: Ic4bacffab3fdd9d23bea9b1ecd0f2cfdecb82e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399060
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-12-05 15:10:34 +00:00
Jens Johansen 67ead166f5 [parser/CFE] Better recovery of partial missing type arguments on type; fix CFE crash
Change-Id: Ifd43ca5b5167e8bacf36e7b89ed8ab57362635b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-12-05 15:04:00 +00:00
Jens Johansen bce3dd4fe7 [CFE/shared] Make formatting more consistent by specifying DartFormatter.latestShortStyleLanguageVersion
Autogenerated files was formatted with the new style, so if one for
instance formatted the file via the IDE or by saying
`out/ReleaseX64/dart-sdk/bin/dart format pkg/front_end/lib/` we'd get
*a lot* of changes which isn't great.
This CL sets the formatter version for the auto-generated files,
hopefully avoiding such things.

Change-Id: I4f92aafde7c77e7c78179f78bf821979a25ec12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398884
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-12-05 08:50:30 +00:00
Paul Berry 0197beaa8e [flow analysis] Remove _typeContains method.
It wasn't necessary; `List.contains` does the same thing.

Also, remove the plumbing for `typeOperations`, a parameter of
`_typeContains` that was not used.

Change-Id: I688835512e58cb7a24336318b2006c9913c77888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398300
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-12-02 18:54:24 +00:00
Paul Berry 6c4c1cb635 Sort declarations in type_analysis_result.dart and mini_ast.dart
Change-Id: Id7d42c294798b4673d5d37deebce5b8720b38388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398280
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2024-12-02 14:21:17 +00:00
Johnni Winther e88020be9a [cfe] Add _PreBuilder
This moves the checking of duplicates, member/setter, and static/instance conflicts to a _PreBuilder.

Change-Id: I85f33750c1579676696223d1b19019887ae41e50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397163
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-11-27 10:18:50 +00:00
Jens Johansen f9b0116566 [CFE] Fix crash when input is utf8 BOM only
Change-Id: I5472dea86fd575c67b7052923344b5d3eee97126
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397541
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-11-27 09:40:41 +00:00
Chloe Stefantsova 38b20fdc98 [analyzer][cfe] Create 'getter-setter-error' feature flag
Part of https://github.com/dart-lang/sdk/issues/58578

Change-Id: I819d4b86761f60d59a8aa95a1dfba1c280499992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396581
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-11-22 07:18:09 +00:00
Paul Berry f601692dd7 [_fe_analyzer_shared] Add SharedNullTypeStructure class.
This is the shared base class for all representations of the type
`Null`. This allows the shared codebase to use `is` tests to tell when
a type is `Null`.

Change-Id: I98059b60c7eaab9c9f1e3f7addb7913dffc9cf9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396380
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-11-20 14:55:00 +00:00
Johnni Winther eb8156415c [cfe] Remove use of 'fasta' in (file)names
Change-Id: Iac3850696fb5e48dff847d17f7110644e8b8bd03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395920
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-11-20 14:22:56 +00:00
Paul Berry 0ebb4fe7d9 Sort declarations in shared_type.dart
Change-Id: Id75cbcb1f49dc21db6ad8536214dec7bd757d55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396301
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-19 17:56:22 +00:00
Chloe Stefantsova d79fcdf4cd [analyzer][cfe] Remove unnecessary use of shared views
This CL removes the unnecessary conversion from `TypeStructure` types
to `SharedTypeView` and `SharedTypeSchemaView` and back. By design,
the shared constraint generation method is operating on
`TypeStructure` types and uses the shared procedures named with the
'Internal' suffix to transform those types. In this CL the shared
procedures that are only used in the shared constraint generation
method or in 'Internal' procedures are converted to 'Internal'
themselves, and the corresponding update in the parameters accepted
and returned by those procedures is made.

Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Ic8596b342bde7e78093e990fc0f12f705ff6dee1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395962
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-11-19 17:17:13 +00:00
Chloe Stefantsova e2c17b938f Enable 'inference-using-bounds' flag in 3.7
TEST=existing

Change-Id: If7f143ab6c60cfda962c1ceba78fdbfdd949a3cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-19 08:54:03 +00:00
Chloe Stefantsova be1b2a9712 [analyzer][cfe] Share type constraint generation
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: I15f7a78c9390466f5a48400f81def175faeb9fd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395020
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-11-14 12:34:42 +00:00
Johnni Winther 72534f18fa [cfe] Remove library fasta.* names
Change-Id: I0a678e971395f70d09a3faf004e6476a9b5a48cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-11-14 07:32:21 +00:00
Chloe Stefantsova 3bc27ffa52 [analyzer][cfe] Share constraint generation from bounded parameters
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: I545ce1faa08448bf6f573550ca1349c124e55e9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394780
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-11-13 15:15:04 +00:00
Jens Johansen 4b7c6b1fa6 [parser] Remove (extension) Token.isA2
With 0ca1ff2281 fixing the reason why we
had `isA2` we can get rid of it. One 100-run-each-benchmark of compiling
a fixed version of the CFE with the current version of the CFE I get

```
msec task-clock:u: -0.3133% +/- 0.2298% (-13.22 +/- 9.70)
cycles:u: -0.4109% +/- 0.2303% (-71702583.62 +/- 40176749.86)
instructions:u: -0.0150% +/- 0.0002% (-3206465.75 +/- 50567.00)
branch-misses:u: -0.9597% +/- 0.8046% (-615355.48 +/- 515877.98)
seconds time elapsed: -0.3138% +/- 0.2297% (-0.01 +/- 0.01)
seconds user: -0.2991% +/- 0.2978% (-0.01 +/- 0.01)
```

(the only real thing to look at here is likely the `instructions:u`
going down by ~3.2 mio.)

For anyone interested:
Manualy testing what 0ca1ff2281 did vs
the commit before (by running it 5 times each by hand through perf stat)
I get

instructions:u: -0.0831338% +/- 0.00115149% (-1.78503e+07 +/- 247246)
(i.e. almost 18 mio less instructions).
Change-Id: I01600c33364933da262b3354298255e8b2df8afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394101
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-11-13 15:10:51 +00:00
Jens Johansen 0b07f2ebae [parser] Better recovery on variable declaration with missing name before type parameter
Change-Id: Ie3e2995748c6f36c2cd98235658cbadfc53157a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394303
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-11-13 08:41:41 +00:00
Chloe Stefantsova e25fecfcd8 [analyzer][cfe] Share left-FutureOr constraint gathering
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: I825e522f370ac7fd39466b5f6aa6571fea5b5633
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394501
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-11-13 07:53:54 +00:00