diff --git a/pkg/dart2wasm/lib/record_class_generator.dart b/pkg/dart2wasm/lib/record_class_generator.dart index e5f6c4a2dd6..4c9ada35b01 100644 --- a/pkg/dart2wasm/lib/record_class_generator.dart +++ b/pkg/dart2wasm/lib/record_class_generator.dart @@ -395,7 +395,8 @@ class _RecordClassGenerator { Procedure( Name('toString', library), ProcedureKind.Method, - FunctionNode(ReturnStatement(stringExpression)), + FunctionNode(ReturnStatement(stringExpression), + returnType: coreTypes.stringNonNullableRawType), fileUri: library.fileUri, ), coreTypes);