forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix to use string literal type in ArrayBuffer's
Symbol.toStringTag
(m…
- Loading branch information
1 parent
244303f
commit 8ae98d0
Showing
7 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
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
11 changes: 11 additions & 0 deletions
11
tests/baselines/reference/assignSharedArrayBufferToArrayBuffer.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,11 @@ | ||
assignSharedArrayBufferToArrayBuffer.ts(1,5): error TS2322: Type 'SharedArrayBuffer' is not assignable to type 'ArrayBuffer'. | ||
Types of property '[Symbol.toStringTag]' are incompatible. | ||
Type '"SharedArrayBuffer"' is not assignable to type '"ArrayBuffer"'. | ||
|
||
|
||
==== assignSharedArrayBufferToArrayBuffer.ts (1 errors) ==== | ||
var foo: ArrayBuffer = new SharedArrayBuffer(1024); // should error | ||
~~~ | ||
!!! error TS2322: Type 'SharedArrayBuffer' is not assignable to type 'ArrayBuffer'. | ||
!!! error TS2322: Types of property '[Symbol.toStringTag]' are incompatible. | ||
!!! error TS2322: Type '"SharedArrayBuffer"' is not assignable to type '"ArrayBuffer"'. |
7 changes: 7 additions & 0 deletions
7
tests/baselines/reference/assignSharedArrayBufferToArrayBuffer.js
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,7 @@ | ||
//// [tests/cases/conformance/es2017/assignSharedArrayBufferToArrayBuffer.ts] //// | ||
|
||
//// [assignSharedArrayBufferToArrayBuffer.ts] | ||
var foo: ArrayBuffer = new SharedArrayBuffer(1024); // should error | ||
|
||
//// [assignSharedArrayBufferToArrayBuffer.js] | ||
var foo = new SharedArrayBuffer(1024); // should error |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/assignSharedArrayBufferToArrayBuffer.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,8 @@ | ||
//// [tests/cases/conformance/es2017/assignSharedArrayBufferToArrayBuffer.ts] //// | ||
|
||
=== assignSharedArrayBufferToArrayBuffer.ts === | ||
var foo: ArrayBuffer = new SharedArrayBuffer(1024); // should error | ||
>foo : Symbol(foo, Decl(assignSharedArrayBufferToArrayBuffer.ts, 0, 3)) | ||
>ArrayBuffer : Symbol(ArrayBuffer, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) | ||
>SharedArrayBuffer : Symbol(SharedArrayBuffer, Decl(lib.es2017.sharedmemory.d.ts, --, --), Decl(lib.es2017.sharedmemory.d.ts, --, --)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/assignSharedArrayBufferToArrayBuffer.types
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,13 @@ | ||
//// [tests/cases/conformance/es2017/assignSharedArrayBufferToArrayBuffer.ts] //// | ||
|
||
=== assignSharedArrayBufferToArrayBuffer.ts === | ||
var foo: ArrayBuffer = new SharedArrayBuffer(1024); // should error | ||
>foo : ArrayBuffer | ||
> : ^^^^^^^^^^^ | ||
>new SharedArrayBuffer(1024) : SharedArrayBuffer | ||
> : ^^^^^^^^^^^^^^^^^ | ||
>SharedArrayBuffer : SharedArrayBufferConstructor | ||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
>1024 : 1024 | ||
> : ^^^^ | ||
|
4 changes: 4 additions & 0 deletions
4
tests/cases/conformance/es2017/assignSharedArrayBufferToArrayBuffer.ts
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,4 @@ | ||
// @target: es5 | ||
// @lib: es2015,es2017.sharedmemory | ||
|
||
var foo: ArrayBuffer = new SharedArrayBuffer(1024); // should error |