Kallen Tu
77cf3047a3
Dot Shorthands: Const selector chains.
...
I changed the parsing of const dot shorthands to parse the entire selector chain in `parsePrecedenceExpression` rather than parsing them in `parseConstExpression`. We were originally parsing the initial expression before the `.` and only flagging that as a dot shorthand which prevented any chaining on const constructors. Const expressions with chained methods/property accesses were not being flagged as a dot shorthand so we weren’t saving the context type properly which led to producing the “unknown context type” error.
Before:
```
class C {
const new someConstCtor();
C method() => this;
}
C c = const .someConstCtor.method();
// (const .someConstCtor) is parsed and handled as a const constructor
// (const .someConstCtor) is handled as a dot shorthand, context is
// saved on only this AST and not the outer chain.
// Then we parse the rest of the selector chain (.method())
//
// Error: No context type for (const .someConstCtor.method())
```
After:
```
class C {
const new someConstCtor();
C method() => this;
}
C c = const .someConstCtor.method();
// (const .someConstCtor) is parsed and handled as a const constructor.
// Then we parse the rest of the selector chain (.method())
// (const .someConstCtor.method()) is handled as a dot shorthand, context is saved for this outer node.
//
// OK. No error because we are able to retrieve the type for the
// entire dot shorthand chain.
```
Fixes: https://github.com/dart-lang/sdk/issues/63119
Change-Id: I3308d8eb7ce101466be257aba6b5448921bff136
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2026-04-24 10:40:26 -07:00
..
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-01-22 11:31:24 -08:00
2026-04-09 06:22:54 -07:00
2025-05-13 10:10:51 -07:00
2025-05-13 10:10:51 -07:00
2025-05-13 10:10:51 -07:00
2025-05-13 10:10:51 -07:00
2025-05-13 10:10:51 -07:00
2025-05-13 10:10:51 -07:00
2025-05-13 10:10:51 -07:00
2025-03-06 13:17:32 -08:00
2025-03-06 13:17:32 -08:00
2025-03-06 13:17:32 -08:00
2025-03-06 13:17:32 -08:00
2025-03-06 13:17:32 -08:00
2025-03-06 13:17:32 -08:00
2025-03-06 13:17:32 -08:00
2025-03-27 09:05:46 -07:00
2025-06-17 04:03:26 -07:00
2025-06-17 04:03:26 -07:00
2025-03-27 09:05:46 -07:00
2025-06-17 04:03:26 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-27 09:05:46 -07:00
2025-03-06 13:17:32 -08:00
2025-06-17 06:15:43 -07:00
2025-06-17 06:15:43 -07:00
2025-06-17 06:15:43 -07:00
2025-08-22 08:05:19 -07:00
2025-03-06 13:17:32 -08:00
2025-03-06 13:17:32 -08:00
2026-04-24 10:40:26 -07:00
2026-04-24 10:40:26 -07:00
2026-04-24 10:40:26 -07:00
2026-04-24 10:40:26 -07:00
2026-04-24 10:40:26 -07:00
2026-04-24 10:40:26 -07:00
2026-04-24 10:40:26 -07:00
2025-03-19 08:52:23 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-19 08:52:23 -07:00
2025-03-19 08:52:23 -07:00
2025-03-25 07:29:02 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-25 07:29:02 -07:00
2025-03-25 07:29:02 -07:00
2025-03-19 08:52:23 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-19 08:52:23 -07:00
2025-03-19 08:52:23 -07:00
2025-04-04 15:29:09 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-04-04 15:29:09 -07:00
2025-04-04 15:29:09 -07:00
2025-04-02 12:44:23 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-04-02 12:44:23 -07:00
2025-04-02 12:44:23 -07:00
2025-03-04 15:32:59 -08:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-04 15:32:59 -08:00
2025-03-04 15:32:59 -08:00
2025-03-06 11:09:20 -08:00
2025-08-19 04:30:41 -07:00
2025-08-19 04:30:41 -07:00
2025-06-17 06:15:43 -07:00
2025-08-19 04:30:41 -07:00
2025-03-06 11:09:20 -08:00
2025-03-06 11:09:20 -08:00
2025-03-06 11:09:20 -08:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-06 11:09:20 -08:00
2025-03-06 11:09:20 -08:00
2025-03-04 15:32:59 -08:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-04 15:32:59 -08:00
2025-03-04 15:32:59 -08:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-08-18 12:38:35 -07:00
2025-08-18 12:38:35 -07:00
2025-08-18 12:38:35 -07:00
2025-08-18 12:38:35 -07:00
2025-08-18 12:38:35 -07:00
2025-08-18 12:38:35 -07:00
2025-08-18 12:38:35 -07:00
2026-02-09 05:34:14 -08:00
2025-03-18 12:28:14 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-18 12:28:14 -07:00
2025-03-18 12:28:14 -07:00
2026-03-18 09:35:30 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-03-18 09:35:30 -07:00
2026-03-18 09:35:30 -07:00
2026-03-18 09:35:30 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-03-18 09:35:30 -07:00
2026-03-18 09:35:30 -07:00
2026-03-18 09:35:30 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-03-18 09:35:30 -07:00
2026-03-18 09:35:30 -07:00
2026-03-18 09:35:30 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-03-18 09:35:30 -07:00
2026-03-18 09:35:30 -07:00
2025-07-21 11:45:32 -07:00
2025-07-21 11:45:32 -07:00
2025-07-21 11:45:32 -07:00
2025-07-21 11:45:32 -07:00
2025-07-21 11:45:32 -07:00
2025-07-21 11:45:32 -07:00
2025-07-21 11:45:32 -07:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-01-22 11:31:24 -08:00
2026-01-22 11:31:24 -08:00
2025-03-12 07:09:06 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-12 07:09:06 -07:00
2025-03-12 07:09:06 -07:00
2025-03-25 07:29:02 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-25 07:29:02 -07:00
2025-03-25 07:29:02 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-06-17 06:15:43 -07:00
2025-06-17 06:15:43 -07:00
2025-06-17 06:15:43 -07:00
2025-06-17 06:15:43 -07:00
2025-03-25 08:28:24 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-03-25 08:28:24 -07:00
2025-03-25 08:28:24 -07:00
2025-04-04 10:47:39 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-04-04 10:47:39 -07:00
2025-04-04 10:47:39 -07:00
2025-04-04 15:29:09 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2026-04-09 06:22:54 -07:00
2025-04-04 15:29:09 -07:00
2025-04-04 15:29:09 -07:00