Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aggregate flags for ExpressionWithTypeArguments
- Loading branch information
Showing
5 changed files
with
136 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//// [jsxInExtendsClause.tsx] | ||
// https://github.com/Microsoft/TypeScript/issues/13157 | ||
declare namespace React { | ||
interface ComponentClass<P> { new (): Component<P, {}>; } | ||
class Component<A, B> {} | ||
} | ||
declare function createComponentClass<P>(factory: () => React.ComponentClass<P>): React.ComponentClass<P>; | ||
class Foo extends createComponentClass(() => class extends React.Component<{}, {}> { | ||
render() { | ||
return <span>Hello, world!</span>; | ||
} | ||
}) {} | ||
|
||
//// [jsxInExtendsClause.js] | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var Foo = (function (_super) { | ||
__extends(Foo, _super); | ||
function Foo() { | ||
return _super.apply(this, arguments) || this; | ||
} | ||
return Foo; | ||
}(createComponentClass(function () { return (function (_super) { | ||
__extends(class_1, _super); | ||
function class_1() { | ||
return _super.apply(this, arguments) || this; | ||
} | ||
class_1.prototype.render = function () { | ||
return React.createElement("span", null, "Hello, world!"); | ||
}; | ||
return class_1; | ||
}(React.Component)); }))); |
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,42 @@ | ||
=== tests/cases/compiler/jsxInExtendsClause.tsx === | ||
// https://github.com/Microsoft/TypeScript/issues/13157 | ||
declare namespace React { | ||
>React : Symbol(React, Decl(jsxInExtendsClause.tsx, 0, 0)) | ||
|
||
interface ComponentClass<P> { new (): Component<P, {}>; } | ||
>ComponentClass : Symbol(ComponentClass, Decl(jsxInExtendsClause.tsx, 1, 25)) | ||
>P : Symbol(P, Decl(jsxInExtendsClause.tsx, 2, 27)) | ||
>Component : Symbol(Component, Decl(jsxInExtendsClause.tsx, 2, 59)) | ||
>P : Symbol(P, Decl(jsxInExtendsClause.tsx, 2, 27)) | ||
|
||
class Component<A, B> {} | ||
>Component : Symbol(Component, Decl(jsxInExtendsClause.tsx, 2, 59)) | ||
>A : Symbol(A, Decl(jsxInExtendsClause.tsx, 3, 18)) | ||
>B : Symbol(B, Decl(jsxInExtendsClause.tsx, 3, 20)) | ||
} | ||
declare function createComponentClass<P>(factory: () => React.ComponentClass<P>): React.ComponentClass<P>; | ||
>createComponentClass : Symbol(createComponentClass, Decl(jsxInExtendsClause.tsx, 4, 1)) | ||
>P : Symbol(P, Decl(jsxInExtendsClause.tsx, 5, 38)) | ||
>factory : Symbol(factory, Decl(jsxInExtendsClause.tsx, 5, 41)) | ||
>React : Symbol(React, Decl(jsxInExtendsClause.tsx, 0, 0)) | ||
>ComponentClass : Symbol(React.ComponentClass, Decl(jsxInExtendsClause.tsx, 1, 25)) | ||
>P : Symbol(P, Decl(jsxInExtendsClause.tsx, 5, 38)) | ||
>React : Symbol(React, Decl(jsxInExtendsClause.tsx, 0, 0)) | ||
>ComponentClass : Symbol(React.ComponentClass, Decl(jsxInExtendsClause.tsx, 1, 25)) | ||
>P : Symbol(P, Decl(jsxInExtendsClause.tsx, 5, 38)) | ||
|
||
class Foo extends createComponentClass(() => class extends React.Component<{}, {}> { | ||
>Foo : Symbol(Foo, Decl(jsxInExtendsClause.tsx, 5, 106)) | ||
>createComponentClass : Symbol(createComponentClass, Decl(jsxInExtendsClause.tsx, 4, 1)) | ||
>React.Component : Symbol(React.Component, Decl(jsxInExtendsClause.tsx, 2, 59)) | ||
>React : Symbol(React, Decl(jsxInExtendsClause.tsx, 0, 0)) | ||
>Component : Symbol(React.Component, Decl(jsxInExtendsClause.tsx, 2, 59)) | ||
|
||
render() { | ||
>render : Symbol((Anonymous class).render, Decl(jsxInExtendsClause.tsx, 6, 84)) | ||
|
||
return <span>Hello, world!</span>; | ||
>span : Symbol(unknown) | ||
>span : Symbol(unknown) | ||
} | ||
}) {} |
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,46 @@ | ||
=== tests/cases/compiler/jsxInExtendsClause.tsx === | ||
// https://github.com/Microsoft/TypeScript/issues/13157 | ||
declare namespace React { | ||
>React : typeof React | ||
|
||
interface ComponentClass<P> { new (): Component<P, {}>; } | ||
>ComponentClass : ComponentClass<P> | ||
>P : P | ||
>Component : Component<A, B> | ||
>P : P | ||
|
||
class Component<A, B> {} | ||
>Component : Component<A, B> | ||
>A : A | ||
>B : B | ||
} | ||
declare function createComponentClass<P>(factory: () => React.ComponentClass<P>): React.ComponentClass<P>; | ||
>createComponentClass : <P>(factory: () => React.ComponentClass<P>) => React.ComponentClass<P> | ||
>P : P | ||
>factory : () => React.ComponentClass<P> | ||
>React : any | ||
>ComponentClass : React.ComponentClass<P> | ||
>P : P | ||
>React : any | ||
>ComponentClass : React.ComponentClass<P> | ||
>P : P | ||
|
||
class Foo extends createComponentClass(() => class extends React.Component<{}, {}> { | ||
>Foo : Foo | ||
>createComponentClass(() => class extends React.Component<{}, {}> { render() { return <span>Hello, world!</span>; }}) : React.Component<{}, {}> | ||
>createComponentClass : <P>(factory: () => React.ComponentClass<P>) => React.ComponentClass<P> | ||
>() => class extends React.Component<{}, {}> { render() { return <span>Hello, world!</span>; }} : () => typeof (Anonymous class) | ||
>class extends React.Component<{}, {}> { render() { return <span>Hello, world!</span>; }} : typeof (Anonymous class) | ||
>React.Component : React.Component<{}, {}> | ||
>React : typeof React | ||
>Component : typeof React.Component | ||
|
||
render() { | ||
>render : () => any | ||
|
||
return <span>Hello, world!</span>; | ||
><span>Hello, world!</span> : any | ||
>span : any | ||
>span : 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,12 @@ | ||
// @jsx: react | ||
// https://github.com/Microsoft/TypeScript/issues/13157 | ||
declare namespace React { | ||
interface ComponentClass<P> { new (): Component<P, {}>; } | ||
class Component<A, B> {} | ||
} | ||
declare function createComponentClass<P>(factory: () => React.ComponentClass<P>): React.ComponentClass<P>; | ||
class Foo extends createComponentClass(() => class extends React.Component<{}, {}> { | ||
render() { | ||
return <span>Hello, world!</span>; | ||
} | ||
}) {} |