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
While trying to update Angular to typescript@3.7.0-beta in angular/angular#32962, I came across this error emitted by tsickle:
Error: rest parameter does not resolve to a reference type
at ModuleTypeTranslator.getFunctionTypeJSDoc (/home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/sandbox/processwrapper-sandbox/378/execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.sh.runfiles/npm/node_modules/tsickle/src/module_type_translator.js:424:39)
at visitFunctionLikeDeclaration (/home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/sandbox/processwrapper-sandbox/378/execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.sh.runfiles/npm/node_modules/tsickle/src/jsdoc_transformer.js:527:75)
at visitor (/home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/sandbox/processwrapper-sandbox/378/execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.sh.runfiles/npm/node_modules/tsickle/src/jsdoc_transformer.js:913:36)
at visitNodes (/home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/sandbox/processwrapper-sandbox/378/execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.sh.runfiles/npm/node_modules/typescript/lib/typescript.js:70546:48)
at visitLexicalEnvironment (/home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/sandbox/processwrapper-sandbox/378/execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.sh.runfiles/npm/node_modules/typescript/lib/typescript.js:70579:22)
...
This corresponds to the following code in tsickle:
if (type.flags & ts.TypeFlags.Object &&
type.objectFlags & ts.ObjectFlags.Reference) {
const typeRef = type;
if (!typeRef.typeArguments) {
throw new Error('rest parameter does not resolve to a reference type');
}
type = typeRef.typeArguments[0];
}
This seems to be another instance of microsoft/TypeScript#33693, a breaking change that affects Angular. It's easy to work around though:
before:
const typeReference = type as ts.TypeReference;
if (typeReference.typeArguments && typeReference.typeArguments.length === 1) {
return typeReference.typeArguments[0].symbol;
}
after
const typeReference = type as ts.TypeReference;
const typeArguments = this.checker.getTypeArguments(typeReference);
if (typeArguments.length === 1) {
return typeArguments[0].symbol;
}
The text was updated successfully, but these errors were encountered:
While trying to update Angular to
typescript@3.7.0-beta
in angular/angular#32962, I came across this error emitted bytsickle
:This corresponds to the following code in
tsickle
:This seems to be another instance of microsoft/TypeScript#33693, a breaking change that affects Angular. It's easy to work around though:
before:
after
The text was updated successfully, but these errors were encountered: