Skip to content

Commit d147616

Browse files
committed
Update test
1 parent 5fcf777 commit d147616

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

tests/baselines/reference/partialType2.errors.txt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
tests/cases/compiler/partialType2.ts(8,12): error TS2304: Cannot find name 'subset'.
2-
tests/cases/compiler/partialType2.ts(8,19): error TS1005: '=' expected.
3-
tests/cases/compiler/partialType2.ts(8,19): error TS2693: 'T' only refers to a type, but is being used as a value here.
1+
tests/cases/compiler/partialType2.ts(10,5): error TS2322: Type 'partial T' is not assignable to type 'T'.
42
tests/cases/compiler/partialType2.ts(16,5): error TS2322: Type '{ name: string; length: number; foo: number; }' is not assignable to type 'partial T'.
53
tests/cases/compiler/partialType2.ts(18,11): error TS2339: Property 'name' does not exist on type 'partial T'.
64

75

8-
==== tests/cases/compiler/partialType2.ts (5 errors) ====
6+
==== tests/cases/compiler/partialType2.ts (3 errors) ====
97
interface State {
108
name: string;
119
length: number;
1210
foo?: number;
1311
}
1412

1513
function doSomething1<T>(x: T) {
16-
let y: subset T = <any>null;
17-
~~~~~~
18-
!!! error TS2304: Cannot find name 'subset'.
19-
~
20-
!!! error TS1005: '=' expected.
21-
~
22-
!!! error TS2693: 'T' only refers to a type, but is being used as a value here.
14+
let y: partial T = <any>null;
2315
y = x; // Should be OK
2416
x = y; // Error
17+
~
18+
!!! error TS2322: Type 'partial T' is not assignable to type 'T'.
2519
}
2620

2721
function doSomething2<T extends State>(x: T) {

tests/baselines/reference/partialType2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface State {
66
}
77

88
function doSomething1<T>(x: T) {
9-
let y: subset T = <any>null;
9+
let y: partial T = <any>null;
1010
y = x; // Should be OK
1111
x = y; // Error
1212
}
@@ -28,7 +28,7 @@ function doSomething2<T extends State>(x: T) {
2828

2929
//// [partialType2.js]
3030
function doSomething1(x) {
31-
var y = T = null;
31+
var y = null;
3232
y = x; // Should be OK
3333
x = y; // Error
3434
}

tests/cases/compiler/partialType2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface State {
55
}
66

77
function doSomething1<T>(x: T) {
8-
let y: subset T = <any>null;
8+
let y: partial T = <any>null;
99
y = x; // Should be OK
1010
x = y; // Error
1111
}

0 commit comments

Comments
 (0)