Skip to content

Commit

Permalink
[stable][cfe] Place return type into parameter scope in TypeBuilderCo…
Browse files Browse the repository at this point in the history
…mputer

Closes flutter/flutter#143689

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/355401
Cherry-pick-request: #55158
Change-Id: I129458871c91f1d7a1c331a62f2388e3431fe271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356760
Reviewed-by: Johnni Winther <[email protected]>
  • Loading branch information
chloestefantsova committed Mar 14, 2024
1 parent d62c54e commit 99b7157
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 3.3.2

This is a patch release that:

- Fixes an issue in the CFE that placed some structural parameter references out
of their context in the code restored from dill files, causing crashes in the
incremental compiler whenever it restored a typedef from dill such that the
typedef contained a generic function type on its right-hand side (issue
[#55158][]).

[#55158]: https://github.com/dart-lang/sdk/issues/55158

## 3.3.1 - 2024-03-06

This is a patch release that:
Expand Down
5 changes: 3 additions & 2 deletions pkg/front_end/lib/src/fasta/kernel/type_builder_computer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ class _TypeBuilderComputerHelper
@override
TypeBuilder visitFunctionType(FunctionType node,
Map<TypeParameter, NominalVariableBuilder> pendingNominalVariables) {
TypeBuilder returnType =
node.returnType.accept1(this, pendingNominalVariables);
List<StructuralVariableBuilder>? typeVariables = null;
if (node.typeParameters.isNotEmpty) {
typeVariables = <StructuralVariableBuilder>[
Expand All @@ -176,6 +174,9 @@ class _TypeBuilderComputerHelper
];
}

TypeBuilder returnType =
node.returnType.accept1(this, pendingNominalVariables);

List<DartType> positionalParameters = node.positionalParameters;
List<NamedType> namedParameters = node.namedParameters;
List<ParameterBuilder> formals = new List<ParameterBuilder>.filled(
Expand Down

0 comments on commit 99b7157

Please sign in to comment.