mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 13:30:40 +00:00
ae35ada579
- Improve ComparisonPrecedence lint suggestions for three-way comparisons (X < Y < Z) - Improve type checking stability - Improve location information for errors when parsing invalid type annotations - Compiler now generates bytecode version 3 in all configurations - Improve performance of comparisons against numeric constants on AArch64
39 lines
No EOL
1.1 KiB
C++
39 lines
No EOL
1.1 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, InternalErrorReporter* iceHandler, TypeId anyType, TypePackId anyTypePack);
|
|
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;
|
|
};
|
|
|
|
} // namespace Luau
|