Skip to content

Commit

Permalink
[dart2wasm] Fix sync* iterable element types
Browse files Browse the repository at this point in the history
Fixes tests:

- co19/Language/Functions/element_type_A01_t03
- co19/Language/Functions/element_type_A01_t04
- co19/Language/Functions/element_type_A01_t06

Fixes #54413.

Same change for `async*` functions was made in
https://dart-review.googlesource.com/c/sdk/+/342561.

Change-Id: Ib9e23b3fff9e2f1b952b5ba114ec70d5a8aea372
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343141
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Ömer Ağacan <[email protected]>
  • Loading branch information
osa1 authored and Commit Queue committed Dec 22, 2023
1 parent 64584c1 commit 4d3895a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/dart2wasm/lib/sync_star.dart
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,7 @@ class SyncStarCodeGenerator extends CodeGenerator {
FunctionNode functionNode, Context? context, w.BaseFunction resumeFun) {
// Instantiate a [_SyncStarIterable] containing the context and resume
// function for this `sync*` function.
DartType returnType = functionNode.returnType;
DartType elementType = returnType is InterfaceType &&
returnType.classNode == translator.coreTypes.iterableClass
? returnType.typeArguments.single
: DynamicType();
DartType elementType = functionNode.emittedValueType!;
translator.functions.allocateClass(syncStarIterableInfo.classId);
b.i32_const(syncStarIterableInfo.classId);
b.i32_const(initialIdentityHash);
Expand Down

0 comments on commit 4d3895a

Please sign in to comment.