Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle multiple levesl of substitutions and indexed accesses in getAc…
…tualTypeVariable
  • Loading branch information
jakebailey committed Feb 19, 2023
commit 58ccfeeee50749fe4529f7a02aa2040495eaab16
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17624,7 +17624,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {

function getActualTypeVariable(type: Type): Type {
if (type.flags & TypeFlags.Substitution) {
return (type as SubstitutionType).baseType;
return getActualTypeVariable((type as SubstitutionType).baseType);
}
if (type.flags & TypeFlags.IndexedAccess && (
(type as IndexedAccessType).objectType.flags & TypeFlags.Substitution ||
Expand Down
27 changes: 0 additions & 27 deletions tests/baselines/reference/inferRestArgumentsMappedTuple.errors.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare function extractPrimitivesOld<Tuple extends any[]>(...mappedTypes: Tuple
// [string, number]
const myPrimitiveTupleOld: [string, number] = extractPrimitivesOld({ primitive: "" }, { primitive: 0 });
>myPrimitiveTupleOld : [string, number]
>extractPrimitivesOld({ primitive: "" }, { primitive: 0 }) : [unknown, unknown]
>extractPrimitivesOld({ primitive: "" }, { primitive: 0 }) : [string, number]
>extractPrimitivesOld : <Tuple extends any[]>(...mappedTypes: TupleMapperOld<Tuple>) => Tuple
>{ primitive: "" } : { primitive: string; }
>primitive : string
Expand Down