2021-10-29 16:25:12 -04:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Luau/Error.h"
|
|
|
|
#include "Luau/Location.h"
|
|
|
|
#include "Luau/TypeVar.h"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
|
2022-09-01 19:14:03 -04:00
|
|
|
struct TxnLog;
|
|
|
|
|
2021-10-29 16:25:12 -04:00
|
|
|
using ScopePtr = std::shared_ptr<struct Scope>;
|
|
|
|
|
2022-09-08 18:14:25 -04:00
|
|
|
std::optional<TypeId> findMetatableEntry(
|
|
|
|
NotNull<SingletonTypes> singletonTypes, ErrorVec& errors, TypeId type, const std::string& entry, Location location);
|
|
|
|
std::optional<TypeId> findTablePropertyRespectingMeta(
|
|
|
|
NotNull<SingletonTypes> singletonTypes, ErrorVec& errors, TypeId ty, const std::string& name, Location location);
|
|
|
|
std::optional<TypeId> getIndexTypeFromType(const ScopePtr& scope, ErrorVec& errors, TypeArena* arena, NotNull<SingletonTypes> singletonTypes,
|
|
|
|
TypeId type, const std::string& prop, const Location& location, bool addErrors, InternalErrorReporter& handle);
|
2022-09-01 19:14:03 -04:00
|
|
|
|
|
|
|
// Returns the minimum and maximum number of types the argument list can accept.
|
2022-09-15 18:38:17 -04:00
|
|
|
std::pair<size_t, std::optional<size_t>> getParameterExtents(const TxnLog* log, TypePackId tp, bool includeHiddenVariadics = false);
|
2021-10-29 16:25:12 -04:00
|
|
|
|
|
|
|
} // namespace Luau
|