Skip to content

Commit

Permalink
Strengthen supertype reduction check to reduce breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Mar 26, 2019
1 parent cbbbda4 commit d5f32bd
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 178 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11181,7 +11181,7 @@ namespace ts {
}
else {
const sub = instantiateType((<SubstitutionType>type).substitute, mapper);
if (sub.flags & TypeFlags.AnyOrUnknown || isTypeSubtypeOf(maybeVariable, sub)) {
if (sub.flags & TypeFlags.AnyOrUnknown || isTypeSubtypeOf(getRestrictiveInstantiation(maybeVariable), getRestrictiveInstantiation(sub))) {
return maybeVariable;
}
return sub;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
>ComponentType : ComponentType<P>

export type Shared<
>Shared : any
>Shared : Shared<InjectedProps, DecorationTargetProps>

InjectedProps,
DecorationTargetProps extends Shared<InjectedProps, DecorationTargetProps>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
>Omit : Pick<T, Exclude<keyof T, K>>

type Shared< // Circularly self constraining type, defered thanks to mapping
>Shared : any
>Shared : Shared<InjectedProps, DecorationTargetProps>

InjectedProps,
DecorationTargetProps extends Shared<InjectedProps, DecorationTargetProps>
Expand Down

0 comments on commit d5f32bd

Please sign in to comment.