Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove renaming from declaration output
- Loading branch information
Showing
10 changed files
with
160 additions
and
19 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
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
4 changes: 2 additions & 2 deletions
4
tests/baselines/reference/declarationEmitBindingPatterns.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
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/destructuringInFunctionType.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,30 @@ | ||
tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts(12,18): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts(12,28): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
|
||
==== tests/cases/conformance/es6/destructuring/destructuringInFunctionType.ts (2 errors) ==== | ||
interface a { a } | ||
interface b { b } | ||
interface c { c } | ||
|
||
type T1 = ([a, b, c]); | ||
type F1 = ([a, b, c]) => void; | ||
|
||
type T2 = ({ a }); | ||
type F2 = ({ a }) => void; | ||
|
||
type T3 = ([{ a: b }, { b: a }]); | ||
type F3 = ([{ a: b }, { b: a }]) => void; | ||
~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
type T4 = ([{ a: [b, c] }]); | ||
type F4 = ([{ a: [b, c] }]) => void; | ||
|
||
type C1 = new ([{ a: [b, c] }]) => void; | ||
|
||
var v1 = ([a, b, c]) => "hello"; | ||
var v2: ([a, b, c]) => 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
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/excessPropertyCheckWithSpread.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,23 @@ | ||
tests/cases/compiler/excessPropertyCheckWithSpread.ts(1,25): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
|
||
==== tests/cases/compiler/excessPropertyCheckWithSpread.ts (1 errors) ==== | ||
declare function f({ a: number }): void | ||
~~~~~~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
interface I { | ||
readonly n: number; | ||
} | ||
declare let i: I; | ||
f({ a: 1, ...i }); | ||
|
||
interface R { | ||
opt?: number | ||
} | ||
interface L { | ||
opt: string | ||
} | ||
declare let l: L; | ||
declare let r: R; | ||
f({ a: 1, ...l, ...r }); | ||
|
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/paramterDestrcuturingDeclaration.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,14 @@ | ||
tests/cases/compiler/paramterDestrcuturingDeclaration.ts(2,10): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
tests/cases/compiler/paramterDestrcuturingDeclaration.ts(3,14): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
|
||
==== tests/cases/compiler/paramterDestrcuturingDeclaration.ts (2 errors) ==== | ||
interface C { | ||
({p: name}): any; | ||
~~~~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
new ({p: boolean}): any; | ||
~~~~~~~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
} | ||
|
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
48 changes: 48 additions & 0 deletions
48
tests/baselines/reference/tsxStatelessFunctionComponentOverload1.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,48 @@ | ||
tests/cases/conformance/jsx/file.tsx(17,39): error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
|
||
|
||
==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== | ||
import React = require('react') | ||
|
||
declare function OneThing(k: {yxx: string}): JSX.Element; | ||
declare function OneThing(k: {yxx1: string, children: string}): JSX.Element; | ||
declare function OneThing(l: {yy: number, yy1: string}): JSX.Element; | ||
declare function OneThing(l: {yy: number, yy1: string, yy2: boolean}): JSX.Element; | ||
declare function OneThing(l1: {data: string, "data-prop": boolean}): JSX.Element; | ||
|
||
// OK | ||
const c1 = <OneThing yxx='ok' /> | ||
const c2 = <OneThing yy={100} yy1="hello"/> | ||
const c3 = <OneThing yxx="hello" ignore-prop /> | ||
const c4 = <OneThing data="hello" data-prop /> | ||
const c5 = <OneThing yxx1='ok'>Hello</OneThing> | ||
|
||
|
||
declare function TestingOneThing({y1: string}): JSX.Element; | ||
~~~~~~ | ||
!!! error TS2797: Renaming a property in destructuring assignment is only allowed in a function or constructor implementation. | ||
declare function TestingOneThing(j: {"extra-data": string, yy?: string}): JSX.Element; | ||
declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Element; | ||
declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element; | ||
|
||
// OK | ||
const d1 = <TestingOneThing y1 extra-data />; | ||
const d2 = <TestingOneThing extra-data="hello" />; | ||
const d3 = <TestingOneThing extra-data="hello" yy="hihi" />; | ||
const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />; | ||
const d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob" />; | ||
|
||
|
||
declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; | ||
declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element; | ||
|
||
// OK | ||
const e1 = <TestingOptional /> | ||
const e3 = <TestingOptional y1="hello"/> | ||
const e4 = <TestingOptional y1="hello" y2={1000} /> | ||
const e5 = <TestingOptional y1 y3/> | ||
const e6 = <TestingOptional y1 y3 y2={10} /> | ||
const e2 = <TestingOptional y1 y3 extra-prop/> | ||
|
||
|
||
|