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
{{ message }}
Repository navigation
TypeScript preserves 'override' modifier in JavaScript output #43535
I'm not sure where to ask this, but it seems like tsc is compiling and leaving the override keyword in the compiled result. Is this something other folks are seeing? It seems like it needs the signature to match exactly, or it will show up in the output, see here:
We hit this issue in Chrome DevTools while attempting to upgrade to 4.3.0 (tracked at https://bugs.chromium.org/p/chromium/issues/detail?id=1196203). DevTools uses a lot of @override annotations back from our Closure Compiler time. We discovered that some of the override annotations were leftover in .ts files. When fixing these issues, we ran into build process issues when rollup couldn't consume the compiled JavaScript files.
My assumption was that https://github.com/microsoft/TypeScript/blob/master/tests/cases/docker/chrome-devtools-frontend-next/Dockerfile would have caught this issue, but I think we might not have caught this as we are not checking whether the .js files actually run in the Dockerfile. I don't think it is a good idea to also check whether the compiled output runs, since that can introduce flakiness and I think the user tests are only concerning compilations, but that might be an option to look into.
Activity
DanielRosenwasser commentedon Apr 5, 2021
Basically if you're targeting anything ES2015 and newer, you'll get the
overridemodifier.TimvdLippe commentedon Apr 6, 2021
We hit this issue in Chrome DevTools while attempting to upgrade to 4.3.0 (tracked at https://bugs.chromium.org/p/chromium/issues/detail?id=1196203). DevTools uses a lot of
@overrideannotations back from our Closure Compiler time. We discovered that some of the override annotations were leftover in.tsfiles. When fixing these issues, we ran into build process issues whenrollupcouldn't consume the compiled JavaScript files.My assumption was that https://github.com/microsoft/TypeScript/blob/master/tests/cases/docker/chrome-devtools-frontend-next/Dockerfile would have caught this issue, but I think we might not have caught this as we are not checking whether the
.jsfiles actually run in theDockerfile. I don't think it is a good idea to also check whether the compiled output runs, since that can introduce flakiness and I think the user tests are only concerning compilations, but that might be an option to look into.