mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Make index wait for pending indexerTy
This commit is contained in:
parent
a8047b2e46
commit
e831ad2ffc
1 changed files with 13 additions and 0 deletions
|
@ -2206,6 +2206,19 @@ TypeFunctionReductionResult<TypeId> indexFunctionImpl(
|
||||||
return {std::nullopt, true, {}, {}};
|
return {std::nullopt, true, {}, {}};
|
||||||
|
|
||||||
TypeId indexerTy = follow(typeParams.at(1));
|
TypeId indexerTy = follow(typeParams.at(1));
|
||||||
|
|
||||||
|
// Whether the type is still pending.
|
||||||
|
//
|
||||||
|
// TODO: A generalized sanity check function for all type functions?
|
||||||
|
// But it should be optional for customization
|
||||||
|
// for functions that specifically need type function
|
||||||
|
// This here fixes a stack overflow.
|
||||||
|
// https://github.com/luau-lang/luau/issues/1406
|
||||||
|
if (isPending(indexerTy, ctx->solver))
|
||||||
|
{
|
||||||
|
return {std::nullopt, false, {indexerTy}, {}};
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<const NormalizedType> indexerNormTy = ctx->normalizer->normalize(indexerTy);
|
std::shared_ptr<const NormalizedType> indexerNormTy = ctx->normalizer->normalize(indexerTy);
|
||||||
|
|
||||||
// if the indexer failed to normalize, we can't reduce, but know nothing about inhabitance.
|
// if the indexer failed to normalize, we can't reduce, but know nothing about inhabitance.
|
||||||
|
|
Loading…
Add table
Reference in a new issue