mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
537 B
TypeScript
33 lines
537 B
TypeScript
//// [tests/cases/compiler/computedPropertiesWithSetterAssignment.ts] ////
|
|
|
|
//// [a.ts]
|
|
const k = Symbol();
|
|
|
|
const enum Props {
|
|
k = 'k',
|
|
}
|
|
|
|
interface Foo {
|
|
get k(): Set<string>;
|
|
set k(v: Iterable<string>);
|
|
|
|
get [k](): Set<string>;
|
|
set [k](v: Iterable<string>);
|
|
}
|
|
|
|
declare const foo: Foo;
|
|
|
|
foo.k = ['foo'];
|
|
foo['k'] = ['foo'];
|
|
foo[Props.k] = ['foo'];
|
|
foo[k] = ['foo'];
|
|
|
|
|
|
//// [a.js]
|
|
"use strict";
|
|
const k = Symbol();
|
|
foo.k = ['foo'];
|
|
foo['k'] = ['foo'];
|
|
foo["k" /* Props.k */] = ['foo'];
|
|
foo[k] = ['foo'];
|