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.
- Loading branch information
1 parent
9b558f9
commit 49a2599
Showing
17 changed files
with
276 additions
and
1 deletion.
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
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/missingPropertyOfPromise.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,10 @@ | ||
tests/cases/compiler/missingPropertyOfPromise.ts(2,7): error TS2570: Property 'toLowerCase' does not exist on type 'Promise<string>'. Did you forget to await the 'Promise<string>'? | ||
|
||
|
||
==== tests/cases/compiler/missingPropertyOfPromise.ts (1 errors) ==== | ||
function f(x: Promise<string>) { | ||
x.toLowerCase(); | ||
~~~~~~~~~~~ | ||
!!! error TS2570: Property 'toLowerCase' does not exist on type 'Promise<string>'. Did you forget to await the 'Promise<string>'? | ||
} | ||
|
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,10 @@ | ||
//// [missingPropertyOfPromise.ts] | ||
function f(x: Promise<string>) { | ||
x.toLowerCase(); | ||
} | ||
|
||
|
||
//// [missingPropertyOfPromise.js] | ||
function f(x) { | ||
x.toLowerCase(); | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/missingPropertyOfPromise.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,10 @@ | ||
=== tests/cases/compiler/missingPropertyOfPromise.ts === | ||
function f(x: Promise<string>) { | ||
>f : Symbol(f, Decl(missingPropertyOfPromise.ts, 0, 0)) | ||
>x : Symbol(x, Decl(missingPropertyOfPromise.ts, 0, 11)) | ||
>Promise : Symbol(Promise, Decl(lib.d.ts, --, --)) | ||
|
||
x.toLowerCase(); | ||
>x : Symbol(x, Decl(missingPropertyOfPromise.ts, 0, 11)) | ||
} | ||
|
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/compiler/missingPropertyOfPromise.ts === | ||
function f(x: Promise<string>) { | ||
>f : (x: Promise<string>) => void | ||
>x : Promise<string> | ||
>Promise : Promise<T> | ||
|
||
x.toLowerCase(); | ||
>x.toLowerCase() : any | ||
>x.toLowerCase : any | ||
>x : Promise<string> | ||
>toLowerCase : any | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/missingPropertyOfPromiseIntersection.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,18 @@ | ||
tests/cases/compiler/missingPropertyOfPromiseIntersection.ts(10,7): error TS2570: Property 'method' does not exist on type 'Promise<Foo> & Bar'. Did you forget to await the 'Promise<Foo> & Bar'? | ||
|
||
|
||
==== tests/cases/compiler/missingPropertyOfPromiseIntersection.ts (1 errors) ==== | ||
interface Foo { | ||
method(); | ||
} | ||
|
||
interface Bar { | ||
somethingElse(); | ||
} | ||
|
||
function f(x: Promise<Foo> & Bar) { | ||
x.method(); | ||
~~~~~~ | ||
!!! error TS2570: Property 'method' does not exist on type 'Promise<Foo> & Bar'. Did you forget to await the 'Promise<Foo> & Bar'? | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/missingPropertyOfPromiseIntersection.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,18 @@ | ||
//// [missingPropertyOfPromiseIntersection.ts] | ||
interface Foo { | ||
method(); | ||
} | ||
|
||
interface Bar { | ||
somethingElse(); | ||
} | ||
|
||
function f(x: Promise<Foo> & Bar) { | ||
x.method(); | ||
} | ||
|
||
|
||
//// [missingPropertyOfPromiseIntersection.js] | ||
function f(x) { | ||
x.method(); | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/missingPropertyOfPromiseIntersection.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,26 @@ | ||
=== tests/cases/compiler/missingPropertyOfPromiseIntersection.ts === | ||
interface Foo { | ||
>Foo : Symbol(Foo, Decl(missingPropertyOfPromiseIntersection.ts, 0, 0)) | ||
|
||
method(); | ||
>method : Symbol(Foo.method, Decl(missingPropertyOfPromiseIntersection.ts, 0, 15)) | ||
} | ||
|
||
interface Bar { | ||
>Bar : Symbol(Bar, Decl(missingPropertyOfPromiseIntersection.ts, 2, 1)) | ||
|
||
somethingElse(); | ||
>somethingElse : Symbol(Bar.somethingElse, Decl(missingPropertyOfPromiseIntersection.ts, 4, 15)) | ||
} | ||
|
||
function f(x: Promise<Foo> & Bar) { | ||
>f : Symbol(f, Decl(missingPropertyOfPromiseIntersection.ts, 6, 1)) | ||
>x : Symbol(x, Decl(missingPropertyOfPromiseIntersection.ts, 8, 11)) | ||
>Promise : Symbol(Promise, Decl(lib.d.ts, --, --)) | ||
>Foo : Symbol(Foo, Decl(missingPropertyOfPromiseIntersection.ts, 0, 0)) | ||
>Bar : Symbol(Bar, Decl(missingPropertyOfPromiseIntersection.ts, 2, 1)) | ||
|
||
x.method(); | ||
>x : Symbol(x, Decl(missingPropertyOfPromiseIntersection.ts, 8, 11)) | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/missingPropertyOfPromiseIntersection.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,29 @@ | ||
=== tests/cases/compiler/missingPropertyOfPromiseIntersection.ts === | ||
interface Foo { | ||
>Foo : Foo | ||
|
||
method(); | ||
>method : () => any | ||
} | ||
|
||
interface Bar { | ||
>Bar : Bar | ||
|
||
somethingElse(); | ||
>somethingElse : () => any | ||
} | ||
|
||
function f(x: Promise<Foo> & Bar) { | ||
>f : (x: Promise<Foo> & Bar) => void | ||
>x : Promise<Foo> & Bar | ||
>Promise : Promise<T> | ||
>Foo : Foo | ||
>Bar : Bar | ||
|
||
x.method(); | ||
>x.method() : any | ||
>x.method : any | ||
>x : Promise<Foo> & Bar | ||
>method : any | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
tests/baselines/reference/missingPropertyOfPromiseUnion.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,21 @@ | ||
tests/cases/compiler/missingPropertyOfPromiseUnion.ts(11,7): error TS2570: Property 'method' does not exist on type 'Promise<Foo> | Promise<Bar>'. Did you forget to await the 'Promise<Foo> | Promise<Bar>'? | ||
Property 'method' does not exist on type 'Promise<Foo>'. | ||
|
||
|
||
==== tests/cases/compiler/missingPropertyOfPromiseUnion.ts (1 errors) ==== | ||
interface Foo { | ||
method(); | ||
} | ||
|
||
interface Bar { | ||
method(); | ||
somethingElse(); | ||
} | ||
|
||
function f(x: Promise<Foo> | Promise<Bar>) { | ||
x.method(); | ||
~~~~~~ | ||
!!! error TS2570: Property 'method' does not exist on type 'Promise<Foo> | Promise<Bar>'. Did you forget to await the 'Promise<Foo> | Promise<Bar>'? | ||
!!! error TS2570: Property 'method' does not exist on type 'Promise<Foo>'. | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
tests/baselines/reference/missingPropertyOfPromiseUnion.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,19 @@ | ||
//// [missingPropertyOfPromiseUnion.ts] | ||
interface Foo { | ||
method(); | ||
} | ||
|
||
interface Bar { | ||
method(); | ||
somethingElse(); | ||
} | ||
|
||
function f(x: Promise<Foo> | Promise<Bar>) { | ||
x.method(); | ||
} | ||
|
||
|
||
//// [missingPropertyOfPromiseUnion.js] | ||
function f(x) { | ||
x.method(); | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/missingPropertyOfPromiseUnion.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,30 @@ | ||
=== tests/cases/compiler/missingPropertyOfPromiseUnion.ts === | ||
interface Foo { | ||
>Foo : Symbol(Foo, Decl(missingPropertyOfPromiseUnion.ts, 0, 0)) | ||
|
||
method(); | ||
>method : Symbol(Foo.method, Decl(missingPropertyOfPromiseUnion.ts, 0, 15)) | ||
} | ||
|
||
interface Bar { | ||
>Bar : Symbol(Bar, Decl(missingPropertyOfPromiseUnion.ts, 2, 1)) | ||
|
||
method(); | ||
>method : Symbol(Bar.method, Decl(missingPropertyOfPromiseUnion.ts, 4, 15)) | ||
|
||
somethingElse(); | ||
>somethingElse : Symbol(Bar.somethingElse, Decl(missingPropertyOfPromiseUnion.ts, 5, 13)) | ||
} | ||
|
||
function f(x: Promise<Foo> | Promise<Bar>) { | ||
>f : Symbol(f, Decl(missingPropertyOfPromiseUnion.ts, 7, 1)) | ||
>x : Symbol(x, Decl(missingPropertyOfPromiseUnion.ts, 9, 11)) | ||
>Promise : Symbol(Promise, Decl(lib.d.ts, --, --)) | ||
>Foo : Symbol(Foo, Decl(missingPropertyOfPromiseUnion.ts, 0, 0)) | ||
>Promise : Symbol(Promise, Decl(lib.d.ts, --, --)) | ||
>Bar : Symbol(Bar, Decl(missingPropertyOfPromiseUnion.ts, 2, 1)) | ||
|
||
x.method(); | ||
>x : Symbol(x, Decl(missingPropertyOfPromiseUnion.ts, 9, 11)) | ||
} | ||
|
33 changes: 33 additions & 0 deletions
33
tests/baselines/reference/missingPropertyOfPromiseUnion.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,33 @@ | ||
=== tests/cases/compiler/missingPropertyOfPromiseUnion.ts === | ||
interface Foo { | ||
>Foo : Foo | ||
|
||
method(); | ||
>method : () => any | ||
} | ||
|
||
interface Bar { | ||
>Bar : Bar | ||
|
||
method(); | ||
>method : () => any | ||
|
||
somethingElse(); | ||
>somethingElse : () => any | ||
} | ||
|
||
function f(x: Promise<Foo> | Promise<Bar>) { | ||
>f : (x: Promise<Foo> | Promise<Bar>) => void | ||
>x : Promise<Foo> | Promise<Bar> | ||
>Promise : Promise<T> | ||
>Foo : Foo | ||
>Promise : Promise<T> | ||
>Bar : Bar | ||
|
||
x.method(); | ||
>x.method() : any | ||
>x.method : any | ||
>x : Promise<Foo> | Promise<Bar> | ||
>method : any | ||
} | ||
|
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,3 @@ | ||
function f(x: Promise<string>) { | ||
x.toLowerCase(); | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/cases/compiler/missingPropertyOfPromiseIntersection.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,11 @@ | ||
interface Foo { | ||
method(); | ||
} | ||
|
||
interface Bar { | ||
somethingElse(); | ||
} | ||
|
||
function f(x: Promise<Foo> & Bar) { | ||
x.method(); | ||
} |
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,12 @@ | ||
interface Foo { | ||
method(); | ||
} | ||
|
||
interface Bar { | ||
method(); | ||
somethingElse(); | ||
} | ||
|
||
function f(x: Promise<Foo> | Promise<Bar>) { | ||
x.method(); | ||
} |