-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
someTypeRelatedToType now passes isIntersectionConstituent #33213
Merged
sandersn
merged 3 commits into
master
from
fix-missed-intersection-constituent-threading
Sep 4, 2019
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.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,20 @@ | ||
tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx(10,21): error TS2304: Cannot find name 'React'. | ||
|
||
|
||
==== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx (1 errors) ==== | ||
interface F<P> { | ||
(props: P & { children?: boolean }): void; | ||
propTypes: { [K in keyof P]: null extends P ? K : K }; | ||
} | ||
declare function g(C: F<unknown>): string; | ||
export function wu<CP extends { o: object }>(CC: F<CP>) { | ||
class WU { | ||
m() { | ||
g(CC) | ||
return <CC {...(null as unknown as CP)} />; | ||
~~ | ||
!!! error TS2304: Cannot find name 'React'. | ||
} | ||
} | ||
} | ||
|
42 changes: 42 additions & 0 deletions
42
tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.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,42 @@ | ||
//// [quickIntersectionCheckCorrectlyCachesErrors.tsx] | ||
interface F<P> { | ||
(props: P & { children?: boolean }): void; | ||
propTypes: { [K in keyof P]: null extends P ? K : K }; | ||
} | ||
declare function g(C: F<unknown>): string; | ||
export function wu<CP extends { o: object }>(CC: F<CP>) { | ||
class WU { | ||
m() { | ||
g(CC) | ||
return <CC {...(null as unknown as CP)} />; | ||
} | ||
} | ||
} | ||
|
||
|
||
//// [quickIntersectionCheckCorrectlyCachesErrors.js] | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
exports.__esModule = true; | ||
function wu(CC) { | ||
var WU = /** @class */ (function () { | ||
function WU() { | ||
} | ||
WU.prototype.m = function () { | ||
g(CC); | ||
return React.createElement(CC, __assign({}, null)); | ||
}; | ||
return WU; | ||
}()); | ||
} | ||
exports.wu = wu; |
48 changes: 48 additions & 0 deletions
48
tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.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,48 @@ | ||
=== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx === | ||
interface F<P> { | ||
>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0)) | ||
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) | ||
|
||
(props: P & { children?: boolean }): void; | ||
>props : Symbol(props, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 5)) | ||
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) | ||
>children : Symbol(children, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 17)) | ||
|
||
propTypes: { [K in keyof P]: null extends P ? K : K }; | ||
>propTypes : Symbol(F.propTypes, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 1, 46)) | ||
>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18)) | ||
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) | ||
>P : Symbol(P, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 12)) | ||
>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18)) | ||
>K : Symbol(K, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 2, 18)) | ||
} | ||
declare function g(C: F<unknown>): string; | ||
>g : Symbol(g, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 3, 1)) | ||
>C : Symbol(C, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 4, 19)) | ||
>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0)) | ||
|
||
export function wu<CP extends { o: object }>(CC: F<CP>) { | ||
>wu : Symbol(wu, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 4, 42)) | ||
>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19)) | ||
>o : Symbol(o, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 31)) | ||
>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45)) | ||
>F : Symbol(F, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 0, 0)) | ||
>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19)) | ||
|
||
class WU { | ||
>WU : Symbol(WU, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 57)) | ||
|
||
m() { | ||
>m : Symbol(WU.m, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 6, 14)) | ||
|
||
g(CC) | ||
>g : Symbol(g, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 3, 1)) | ||
>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45)) | ||
|
||
return <CC {...(null as unknown as CP)} />; | ||
>CC : Symbol(CC, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 45)) | ||
>CP : Symbol(CP, Decl(quickIntersectionCheckCorrectlyCachesErrors.tsx, 5, 19)) | ||
} | ||
} | ||
} | ||
|
41 changes: 41 additions & 0 deletions
41
tests/baselines/reference/quickIntersectionCheckCorrectlyCachesErrors.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,41 @@ | ||
=== tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.tsx === | ||
interface F<P> { | ||
(props: P & { children?: boolean }): void; | ||
>props : P & { children?: boolean; } | ||
>children : boolean | ||
|
||
propTypes: { [K in keyof P]: null extends P ? K : K }; | ||
>propTypes : { [K in keyof P]: null extends P ? K : K; } | ||
>null : null | ||
} | ||
declare function g(C: F<unknown>): string; | ||
>g : (C: F<unknown>) => string | ||
>C : F<unknown> | ||
|
||
export function wu<CP extends { o: object }>(CC: F<CP>) { | ||
>wu : <CP extends { o: object; }>(CC: F<CP>) => void | ||
>o : object | ||
>CC : F<CP> | ||
|
||
class WU { | ||
>WU : WU | ||
|
||
m() { | ||
>m : () => any | ||
|
||
g(CC) | ||
>g(CC) : string | ||
>g : (C: F<unknown>) => string | ||
>CC : F<CP> | ||
|
||
return <CC {...(null as unknown as CP)} />; | ||
><CC {...(null as unknown as CP)} /> : any | ||
>CC : F<CP> | ||
>(null as unknown as CP) : CP | ||
>null as unknown as CP : CP | ||
>null as unknown : unknown | ||
>null : null | ||
} | ||
} | ||
} | ||
|
15 changes: 15 additions & 0 deletions
15
tests/cases/compiler/quickIntersectionCheckCorrectlyCachesErrors.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,15 @@ | ||
// @jsx: react | ||
// @filename: quickIntersectionCheckCorrectlyCachesErrors.tsx | ||
interface F<P> { | ||
(props: P & { children?: boolean }): void; | ||
propTypes: { [K in keyof P]: null extends P ? K : K }; | ||
} | ||
declare function g(C: F<unknown>): string; | ||
export function wu<CP extends { o: object }>(CC: F<CP>) { | ||
class WU { | ||
m() { | ||
g(CC) | ||
return <CC {...(null as unknown as CP)} />; | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fix that lint failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our parsing for
readonly T[][]
is so bad, and yet we have a lint rule requiring it.