Johnni Winther
|
5493d42be3
|
[cfe] Throw error for null in non-nullable switch in weak mode
This adds thrown exception in weak-mode for exhaustive switch
expressions and statements to catch the unsound `null` values.
Closes #51769
Closes #51053
Change-Id: Ieb89e65f51e84853510fc320b64db01a80a262ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289600
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
|
2023-03-22 10:30:24 +00:00 |
|
Johnni Winther
|
6480e28d5a
|
[cfe] Don't check length on List/Map only containing a rest pattern
Includes a fix for matched value type being invalid, encountered
during development.
Closes #51770
Change-Id: I0c960eaef528f16789e8d9a42340e50f05326cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289602
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
|
2023-03-21 08:39:38 +00:00 |
|
Johnni Winther
|
6d2e6f9452
|
[cfe] Improve switch encoding
Addresses https://github.com/dart-lang/sdk/issues/51554#issuecomment-1466946211
Closes #51391
TEST=existing
Change-Id: Idec105dcfde4a91d0a21a1907777d6c07e5f01b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289224
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
|
2023-03-20 15:21:52 +00:00 |
|
Johnni Winther
|
5d44b804cd
|
[cfe] Avoid unnecessary switch statements
This changes the lowering of switch expressions and pattern switch
statements without continue to only use if-then-else
Change-Id: I3bcbb634ec3153a117c4bd6692a276c1c26e648d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279964
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
|
2023-01-31 18:12:44 +00:00 |
|
Johnni Winther
|
68c326f455
|
[cfe] Refactor pattern matching generation
This enables caching during matching.
Closes https://github.com/dart-lang/sdk/issues/50934
Closes https://github.com/dart-lang/sdk/issues/50987
Change-Id: Iae1d8e0989029a193ba77f58338890d9bfa0c09f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279384
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
|
2023-01-25 08:33:38 +00:00 |
|
Johnni Winther
|
c1bb19d002
|
[cfe] Fix lowering encodings
Cleans up some missing promoted variable gets and temporary
variables that were incorrectly marked as final.
Change-Id: I26412efe2dbb45b807ad6aba7f67c27981b1619c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279011
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
|
2023-01-16 10:13:44 +00:00 |
|
Chloe Stefantsova
|
23c0ff5dba
|
[cfe] Implement desugaring of switch expressions
Part of https://github.com/dart-lang/sdk/issues/49749
Closes https://github.com/dart-lang/sdk/issues/50814
Change-Id: Ie2524c7e5a1fc1a25f392eecbf2e444c89229923
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277685
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
|
2023-01-02 10:16:35 +00:00 |
|
Johnni Winther
|
be7779ae7f
|
[cfe] Handle switch expression in BodyBuilder
Change-Id: Idf987e8bb59a11d1628fc866d677267f439ed5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272300
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
|
2022-11-30 16:21:28 +00:00 |
|