mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Added test.
This commit is contained in:
22
tests/cases/compiler/omitTypeHelperModifiers01.ts
Normal file
22
tests/cases/compiler/omitTypeHelperModifiers01.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// @strict: true
|
||||
|
||||
type A = {
|
||||
a: number;
|
||||
b?: string;
|
||||
readonly c: boolean;
|
||||
d: unknown;
|
||||
};
|
||||
|
||||
type B = Omit<A, 'a'>;
|
||||
|
||||
function f(x: B) {
|
||||
const b = x.b;
|
||||
x.b = "hello";
|
||||
x.b = undefined;
|
||||
|
||||
const c = x.c;
|
||||
x.c = true;
|
||||
|
||||
const d = x.d;
|
||||
x.d = d;
|
||||
}
|
||||
Reference in New Issue
Block a user