Skip to content

Commit e5d220f

Browse files
nshahanCommit Queue
authored and
Commit Queue
committed
[ddc] Support static JS interop in new type system
Issue: #48585 Change-Id: Ie0a69406686512426e30fdc0b7334263d3e596d0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306135 Reviewed-by: Srujan Gaddam <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
1 parent 80d53a6 commit e5d220f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/dev_compiler/lib/src/kernel/type_recipe_generator.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import 'dart:collection';
66

7+
import 'package:_js_interop_checks/src/transformations/static_interop_class_eraser.dart'
8+
show eraseStaticInteropTypesForJSCompilers;
79
import 'package:js_shared/synced/recipe_syntax.dart' show Recipe;
810
import 'package:kernel/ast.dart';
911
import 'package:kernel/class_hierarchy.dart';
@@ -244,6 +246,10 @@ class _TypeRecipeVisitor extends DartTypeVisitor<String> {
244246
@override
245247
String visitInterfaceType(InterfaceType node) {
246248
var cls = node.classNode;
249+
if (isStaticInteropType(cls)) {
250+
return eraseStaticInteropTypesForJSCompilers(_coreTypes, node)
251+
.accept(this);
252+
}
247253
addLiveType(node);
248254
// Generate the interface type recipe.
249255
var recipeBuffer = StringBuffer(interfaceTypeRecipe(cls));
@@ -338,6 +344,10 @@ class _TypeRecipeVisitor extends DartTypeVisitor<String> {
338344
return recipeBuffer.toString();
339345
}
340346

347+
@override
348+
String visitInlineType(InlineType node) =>
349+
node.instantiatedRepresentationType.accept(this);
350+
341351
@override
342352
String visitRecordType(RecordType node) {
343353
var recipeBuffer = StringBuffer(Recipe.startRecordString);

0 commit comments

Comments
 (0)