You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class GenericNumber<T> {
zeroValue: T;
add: (x: T, y: T) => T;
}
let myGenericNumber = new GenericNumber<number>();
myGenericNumber.zeroValue = 0;
myGenericNumber.add = function(x, y) { return x + y; };
let stringNumeric = new GenericNumber<string>();
stringNumeric.zeroValue = "";
stringNumeric.add = function(x, y) { return x + y; };
console.log(stringNumeric.add(stringNumeric.zeroValue, "test"));
log如下:
D:\code\ArkAnalyzer\src\core\graph\Cfg.ts:341
leftOp.setType(method.getReturnType().join('|'));
^
TypeError: method.getReturnType is not a function
at Cfg.typeReference (D:\code\ArkAnalyzer\src\core\graph\Cfg.ts:341:55)
at Scene.typeReference (D:\code\ArkAnalyzer\src\Scene.ts:263:50)
at new Scene (D:\code\ArkAnalyzer\src\Scene.ts:65:14)
at run (D:\code\ArkAnalyzer\tests\SaveTest.ts:11:24)
at Object.<anonymous> (D:\code\ArkAnalyzer\tests\SaveTest.ts:17:1)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.m._compile (D:\code\ArkAnalyzer\node_modules\ts-node\src\index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.require.extensions.<computed> [as .ts] (D:\code\ArkAnalyzer\node_modules\ts-node\src\index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1207:32)
Process exited with code 1
The text was updated successfully, but these errors were encountered:
测试代码:
log如下:
The text was updated successfully, but these errors were encountered: