mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 05:20:38 +00:00
ce2c3b3a4e
- Remove type definitions of `utf8.nfcnormalize`/`nfdnormalize`/`graphemes` that aren't supported by standalone Luau library - Add `lua_costatus` to retrieve extended thread status (similar to `coroutine.status`) - Improve GC sweeping performance (2-10% improvement on allocation-heavy benchmarks)
42 lines
No EOL
1.3 KiB
C++
42 lines
No EOL
1.3 KiB
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, NotNull<Scope> scope, NotNull<SingletonTypes> singletonTypes, InternalErrorReporter* iceHandler, TypeId anyType,
|
|
TypePackId anyTypePack);
|
|
Anyification(TypeArena* arena, const ScopePtr& scope, NotNull<SingletonTypes> singletonTypes, InternalErrorReporter* iceHandler, TypeId anyType,
|
|
TypePackId anyTypePack);
|
|
NotNull<Scope> scope;
|
|
NotNull<SingletonTypes> singletonTypes;
|
|
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;
|
|
};
|
|
|
|
} // namespace Luau
|