File tree 4 files changed +18
-4
lines changed
pkg/dev_compiler/lib/src/kernel 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 46
46
47
47
[ lints-3-0 ] : https://pub.dev/packages/lints/changelog#300
48
48
49
+ #### Development JavaScript compiler (DDC)
50
+
51
+ - Type arguments of ` package:js ` interop types are now printed as ` any ` instead
52
+ of being omitted. This is simply a change to the textual representation of
53
+ package js types that have type arguments. These type arguments are still
54
+ completely ignored by the type system at runtime.
55
+
49
56
## 3.2.0
50
57
51
58
### Language
Original file line number Diff line number Diff line change @@ -3519,6 +3519,13 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
3519
3519
? getLocalClassName (c)
3520
3520
: _emitJsNameWithoutGlobal (c);
3521
3521
if (jsName != null ) {
3522
+ if (type.typeArguments.isNotEmpty) {
3523
+ // This does not handle the type arguments as such, it simply includes
3524
+ // them in the textual representation of this type so you can see them
3525
+ // when printed. They are not used as part of the type system at all.
3526
+ jsName =
3527
+ '$jsName <${type .typeArguments .map ((_ ) => 'any' ).join (', ' )}>' ;
3528
+ }
3522
3529
typeRep = runtimeCall ('packageJSType(#)' , [js.escapedString (jsName)]);
3523
3530
}
3524
3531
}
Original file line number Diff line number Diff line change @@ -7091,7 +7091,7 @@ Value:
7091
7091
{
7092
7092
"style": "background-color: #d9edf7;color: black"
7093
7093
},
7094
- "Instance of 'TestGenericClass<ExampleJSClass, int>'"
7094
+ "Instance of 'TestGenericClass<ExampleJSClass<any> , int>'"
7095
7095
]
7096
7096
-----------------------------------
7097
7097
Test: TestGenericClassJSInterop instance body
@@ -7188,7 +7188,7 @@ Value:
7188
7188
{
7189
7189
"style": "background-color: #d9edf7;color: black"
7190
7190
},
7191
- "TestGenericClass<ExampleJSClass, int>"
7191
+ "TestGenericClass<ExampleJSClass<any> , int>"
7192
7192
]
7193
7193
-----------------------------------
7194
7194
Test: TestGenericClassJSInterop definition formatting body
Original file line number Diff line number Diff line change @@ -7091,7 +7091,7 @@ Value:
7091
7091
{
7092
7092
"style": "background-color: #d9edf7;color: black"
7093
7093
},
7094
- "Instance of 'TestGenericClass<ExampleJSClass, int>'"
7094
+ "Instance of 'TestGenericClass<ExampleJSClass<any> , int>'"
7095
7095
]
7096
7096
-----------------------------------
7097
7097
Test: TestGenericClassJSInterop instance body
@@ -7188,7 +7188,7 @@ Value:
7188
7188
{
7189
7189
"style": "background-color: #d9edf7;color: black"
7190
7190
},
7191
- "TestGenericClass<ExampleJSClass, int>"
7191
+ "TestGenericClass<ExampleJSClass<any> , int>"
7192
7192
]
7193
7193
-----------------------------------
7194
7194
Test: TestGenericClassJSInterop definition formatting body
You can’t perform that action at this time.
0 commit comments