| Code-Review | +1 |
This simplifies how constructor initializers are added to the SourceConstructorBuilder. Previously the initializers were added from both within the body builder, prior to inference, and in the resolver, post inference; and initializer consistency was during for each addition.?
Now all initializers are collected during body building, inferred, and them checked for consistency before being added to the SourceConstructorBuilder.then
This change paves the way for handing primary constructor body declarations which requires a more high-level handling due to it splitting the definition of primary constructors in the two distinct syntactical units which needs to be handled partially, one at a time, during body building.handling?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This simplifies how constructor initializers are added to the SourceConstructorBuilder. Previously the initializers were added from both within the body builder, prior to inference, and in the resolver, post inference; and initializer consistency was during for each addition.Johnni Winther?
Done
Now all initializers are collected during body building, inferred, and them checked for consistency before being added to the SourceConstructorBuilder.Johnni Wintherthen
Done
This change paves the way for handing primary constructor body declarations which requires a more high-level handling due to it splitting the definition of primary constructors in the two distinct syntactical units which needs to be handled partially, one at a time, during body building.Johnni Wintherhandling?
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
6 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
[cfe][PrimaryConstructors] Delay adding initializers
This simplifies how constructor initializers are added to the SourceConstructorBuilder. Previously the initializers were added from both within the body builder, prior to inference, and in the resolver, post inference; and initializer consistency was checked for each addition.
Now all initializers are collected during body building, inferred, and then checked for consistency before being added to the SourceConstructorBuilder.
This change paves the way for handling primary constructor body declarations which requires a more high-level handling due to it splitting the definition of primary constructors in the two distinct syntactical units which needs to be handled partially, one at a time, during body building.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
@johnni...@google.com
This change appears to have broken the source mapped locations of constructor invocations in a stepping test that uses dot shorthands to invoke the constructors.
I bisected and this is indeed the culprit CL but I haven't investigated enough to understand exactly what changed. I'm hoping you might be able to spot something with the context you have.
The failing test run is here:
https://github.com/dart-lang/webdev/actions/runs/20339474962/job/58434543540
The logs are verbose but the TLDR is that when running this code, setting a breakpoint and stepping through a few of the expected locations are wrong. Instead of pointing to the constructor the source location seems to point to one invocation of the constructor instead.
Failing Test Files:
App under test:
Failure message:
```
Expected: [
'main.dart:20:3',
'main.dart:11:15',
'main.dart:9:10',
'main.dart:9:16',
'main.dart:11:20',
'main.dart:22:3',
'main.dart:12:25',
'main.dart:9:10',
'main.dart:9:16',
'main.dart:12:27',
'main.dart:24:3',
'main.dart:13:22',
'main.dart:9:10',
'main.dart:9:16',
'main.dart:13:24',
'main.dart:25:3'
]
Actual: [
'main.dart:20:3',
'main.dart:11:15',
'main.dart:13:26',
'main.dart:9:16',
'main.dart:11:20',
'main.dart:22:3',
'main.dart:12:25',
'main.dart:13:26',
'main.dart:9:16',
'main.dart:12:27',
'main.dart:24:3',
'main.dart:13:22',
'main.dart:13:26',
'main.dart:9:16',
'main.dart:13:24',
'main.dart:25:3'
]
Which: at location [2] is 'main.dart:13:26' instead of 'main.dart:9:10'
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This CL adds file offsets to `FieldInitializer` nodes generated for initializing formals. These were needed to provide the correct location for reported errors, but likely trigger the extra step you see. This is a case of the CFE wanting file offsets but DDC _not_ wanting them but we have no other signal than `TreeNode.fileOffset`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |