mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 22:35:43 +08:00
be2769ad14
- Fix autocomplete not suggesting globals defined after the cursor (fixes #622) - Improve type checker stability - Reduce parser C stack consumption which fixes some stack overflow crashes on deeply nested sources - Improve performance of bit32.extract/replace when width is implied (~3% faster chess) - Improve performance of bit32.extract when field/width are constants (~10% faster base64) - Heap dump now annotates thread stacks with local variable/function names
38 lines
999 B
C++
38 lines
999 B
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
#include "Luau/NotNull.h"
|
|
#include "Luau/Substitution.h"
|
|
#include "Luau/TypeVar.h"
|
|
|
|
#include <memory>
|
|
|
|
namespace Luau
|
|
{
|
|
|
|
struct TypeArena;
|
|
struct Scope;
|
|
struct InternalErrorReporter;
|
|
using ScopePtr = std::shared_ptr<Scope>;
|
|
|
|
// A substitution which replaces free types by any
|
|
struct Anyification : Substitution
|
|
{
|
|
Anyification(TypeArena* arena, const ScopePtr& scope, InternalErrorReporter* iceHandler, TypeId anyType, TypePackId anyTypePack);
|
|
NotNull<Scope> scope;
|
|
InternalErrorReporter* iceHandler;
|
|
|
|
TypeId anyType;
|
|
TypePackId anyTypePack;
|
|
bool normalizationTooComplex = false;
|
|
bool isDirty(TypeId ty) override;
|
|
bool isDirty(TypePackId tp) override;
|
|
TypeId clean(TypeId ty) override;
|
|
TypePackId clean(TypePackId tp) override;
|
|
|
|
bool ignoreChildren(TypeId ty) override;
|
|
bool ignoreChildren(TypePackId ty) override;
|
|
};
|
|
|
|
} |