Skip to content

Commit 885cd99

Browse files
authored
chore: Port annotations for suppressing TS 4.8 type errors. (#6075)
Googlers, see b/260116849 and cl/490119036. Google is internally upgrading to TS 4.8. We haven't yet upgraded so the internal language team has asked us to annotate some code to suppress some TS 4.8 type errors.
1 parent f0630c2 commit 885cd99

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

tensorboard/components/tf_paginated_view/tf-category-paginated-view.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import {
2828
import {TfDomRepeat} from './tf-dom-repeat';
2929

3030
@customElement('tf-category-paginated-view')
31+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
32+
// TS2344: Type 'CategoryItem' does not satisfy the constraint '{}'.
3133
class TfCategoryPaginatedView<CategoryItem> extends TfDomRepeat<CategoryItem> {
3234
static readonly template = html`
3335
<template is="dom-if" if="[[_paneRendered]]" id="ifRendered">

tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,8 @@ class TfGraphControls extends LegacyElementMixin(
12711271
_deviceCheckboxClicked(event: Event) {
12721272
// Update the device map.
12731273
const input = event.target as HTMLInputElement;
1274+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
1275+
// TS2322: Type 'object' is not assignable to type 'DeviceForStats'.
12741276
const devicesForStats: DeviceForStats = Object.assign(
12751277
{},
12761278
this.devicesForStats

tensorboard/webapp/testing/lang.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
* assumed not to have reference loops.
1818
*/
1919
export function deepFreeze<T>(obj: T): T {
20+
// @ts-ignore(go/ts48upgrade) Fix code and remove this comment. Error:
21+
// TS2769: No overload matches this call.
2022
for (const val of Object.values(obj)) {
2123
if (val && typeof val === 'object') {
2224
deepFreeze(val);

0 commit comments

Comments
 (0)