Skip to content

Commit 4d3895a

Browse files
osa1Commit Queue
authored and
Commit Queue
committed
[dart2wasm] Fix sync* iterable element types
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]>
1 parent 64584c1 commit 4d3895a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pkg/dart2wasm/lib/sync_star.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,7 @@ class SyncStarCodeGenerator extends CodeGenerator {
264264
FunctionNode functionNode, Context? context, w.BaseFunction resumeFun) {
265265
// Instantiate a [_SyncStarIterable] containing the context and resume
266266
// function for this `sync*` function.
267-
DartType returnType = functionNode.returnType;
268-
DartType elementType = returnType is InterfaceType &&
269-
returnType.classNode == translator.coreTypes.iterableClass
270-
? returnType.typeArguments.single
271-
: DynamicType();
267+
DartType elementType = functionNode.emittedValueType!;
272268
translator.functions.allocateClass(syncStarIterableInfo.classId);
273269
b.i32_const(syncStarIterableInfo.classId);
274270
b.i32_const(initialIdentityHash);

0 commit comments

Comments
 (0)