-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f0c8b2
commit ff233a9
Showing
43 changed files
with
3,420 additions
and
206 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/accessorBodyInTypeContext.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
tests/cases/compiler/accessorBodyInTypeContext.ts(2,15): error TS1183: An implementation cannot be declared in ambient contexts. | ||
tests/cases/compiler/accessorBodyInTypeContext.ts(6,21): error TS1183: An implementation cannot be declared in ambient contexts. | ||
tests/cases/compiler/accessorBodyInTypeContext.ts(10,15): error TS1183: An implementation cannot be declared in ambient contexts. | ||
tests/cases/compiler/accessorBodyInTypeContext.ts(14,21): error TS1183: An implementation cannot be declared in ambient contexts. | ||
|
||
|
||
==== tests/cases/compiler/accessorBodyInTypeContext.ts (4 errors) ==== | ||
type A = { | ||
get foo() { return 0 } | ||
~~~~~~~~~~~~ | ||
!!! error TS1183: An implementation cannot be declared in ambient contexts. | ||
}; | ||
|
||
type B = { | ||
set foo(v: any) { } | ||
~~~ | ||
!!! error TS1183: An implementation cannot be declared in ambient contexts. | ||
}; | ||
|
||
interface X { | ||
get foo() { return 0 } | ||
~~~~~~~~~~~~ | ||
!!! error TS1183: An implementation cannot be declared in ambient contexts. | ||
} | ||
|
||
interface Y { | ||
set foo(v: any) { } | ||
~~~ | ||
!!! error TS1183: An implementation cannot be declared in ambient contexts. | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//// [accessorBodyInTypeContext.ts] | ||
type A = { | ||
get foo() { return 0 } | ||
}; | ||
|
||
type B = { | ||
set foo(v: any) { } | ||
}; | ||
|
||
interface X { | ||
get foo() { return 0 } | ||
} | ||
|
||
interface Y { | ||
set foo(v: any) { } | ||
} | ||
|
||
|
||
|
||
//// [accessorBodyInTypeContext.js] |
34 changes: 34 additions & 0 deletions
34
tests/baselines/reference/accessorBodyInTypeContext.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
=== tests/cases/compiler/accessorBodyInTypeContext.ts === | ||
type A = { | ||
>A : Symbol(A, Decl(accessorBodyInTypeContext.ts, 0, 0)) | ||
|
||
get foo() { return 0 } | ||
>foo : Symbol(foo, Decl(accessorBodyInTypeContext.ts, 0, 10)) | ||
|
||
}; | ||
|
||
type B = { | ||
>B : Symbol(B, Decl(accessorBodyInTypeContext.ts, 2, 2)) | ||
|
||
set foo(v: any) { } | ||
>foo : Symbol(foo, Decl(accessorBodyInTypeContext.ts, 4, 10)) | ||
>v : Symbol(v, Decl(accessorBodyInTypeContext.ts, 5, 12)) | ||
|
||
}; | ||
|
||
interface X { | ||
>X : Symbol(X, Decl(accessorBodyInTypeContext.ts, 6, 2)) | ||
|
||
get foo() { return 0 } | ||
>foo : Symbol(X.foo, Decl(accessorBodyInTypeContext.ts, 8, 13)) | ||
} | ||
|
||
interface Y { | ||
>Y : Symbol(Y, Decl(accessorBodyInTypeContext.ts, 10, 1)) | ||
|
||
set foo(v: any) { } | ||
>foo : Symbol(Y.foo, Decl(accessorBodyInTypeContext.ts, 12, 13)) | ||
>v : Symbol(v, Decl(accessorBodyInTypeContext.ts, 13, 12)) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
=== tests/cases/compiler/accessorBodyInTypeContext.ts === | ||
type A = { | ||
>A : A | ||
|
||
get foo() { return 0 } | ||
>foo : number | ||
>0 : 0 | ||
|
||
}; | ||
|
||
type B = { | ||
>B : B | ||
|
||
set foo(v: any) { } | ||
>foo : any | ||
>v : any | ||
|
||
}; | ||
|
||
interface X { | ||
get foo() { return 0 } | ||
>foo : number | ||
>0 : 0 | ||
} | ||
|
||
interface Y { | ||
set foo(v: any) { } | ||
>foo : any | ||
>v : any | ||
} | ||
|
||
|
58 changes: 0 additions & 58 deletions
58
tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers.errors.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//// [divergentAccessors1.ts] | ||
// Accessors in interfaces/types | ||
|
||
{ | ||
interface IHasGetSet { | ||
get foo(): number; | ||
set foo(v: number | string); | ||
} | ||
|
||
const ihgs: IHasGetSet = null as any; | ||
ihgs.foo = "32"; | ||
let r_ihgs_foo: number = ihgs.foo; | ||
} | ||
|
||
{ | ||
type T_HasGetSet = { | ||
get foo(): number; | ||
set foo(v: number | string); | ||
} | ||
|
||
const t_hgs: T_HasGetSet = null as any; | ||
t_hgs.foo = "32"; | ||
let r_t_hgs_foo: number = t_hgs.foo; | ||
} | ||
|
||
|
||
//// [divergentAccessors1.js] | ||
"use strict"; | ||
// Accessors in interfaces/types | ||
{ | ||
var ihgs = null; | ||
ihgs.foo = "32"; | ||
var r_ihgs_foo = ihgs.foo; | ||
} | ||
{ | ||
var t_hgs = null; | ||
t_hgs.foo = "32"; | ||
var r_t_hgs_foo = t_hgs.foo; | ||
} |
Oops, something went wrong.