TypeScript/tests/baselines/reference/fuzzy.errors.txt
Wesley Wigham 84f5aa540e
Put error spans deep on nested object literals (#25140)
* Add ncie deep elaborations

* Nice stuff

* Modify tuple error to use length error mroe often

* Accept good baselines

* Accept meh baselines

* Fix literal types

* Calculate elaborations like it was the very first time again~

* Use tristate for enum relationship to ensure elaborations are printed at least once

* Update message text, nits

* move some functions back to where they were

* Add test of deep JSX elaboration

* Add elaboration test with parenthesized expressions, comma expressions, and assignments

* Move check to allow elaborations on more anonymous types

* Fix nits

* Add specialized error to elaborations of nonliteral computed named-members

* Update error message
2018-07-03 19:40:58 -07:00

49 lines
No EOL
1.8 KiB
Text

tests/cases/compiler/fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'.
Property 'alsoWorks' is missing in type 'C'.
tests/cases/compiler/fuzzy.ts(21,34): error TS2322: Type 'this' is not assignable to type 'I'.
Type 'C' is not assignable to type 'I'.
tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Type '{ oneI: this; }' cannot be converted to type 'R'.
Property 'anything' is missing in type '{ oneI: this; }'.
==== tests/cases/compiler/fuzzy.ts (3 errors) ====
module M {
export interface I {
works:()=>R;
alsoWorks:()=>R;
doesntWork:()=>R;
}
export interface R {
anything:number;
oneI:I;
}
export class C implements I {
~
!!! error TS2420: Class 'C' incorrectly implements interface 'I'.
!!! error TS2420: Property 'alsoWorks' is missing in type 'C'.
constructor(public x:number) {
}
works():R {
return <R>({ anything: 1 });
}
doesntWork():R {
return { anything:1, oneI:this };
~~~~
!!! error TS2322: Type 'this' is not assignable to type 'I'.
!!! error TS2322: Type 'C' is not assignable to type 'I'.
!!! related TS6500 tests/cases/compiler/fuzzy.ts:10:9: The expected type comes from property 'oneI' which is declared here on type 'R'
}
worksToo():R {
return <R>({ oneI: this });
~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Type '{ oneI: this; }' cannot be converted to type 'R'.
!!! error TS2352: Property 'anything' is missing in type '{ oneI: this; }'.
}
}
}