Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/Analysis/include/Luau/Quantify.h
2727 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
#pragma once
3
4
#include "Luau/TypeFwd.h"
5
#include "Luau/DenseHash.h"
6
#include "Luau/Unifiable.h"
7
8
#include <vector>
9
#include <optional>
10
11
namespace Luau
12
{
13
14
struct TypeArena;
15
struct Scope;
16
17
void quantify(TypeId ty, TypeLevel level);
18
19
// TODO: This is eerily similar to the pattern that NormalizedExternType
20
// implements. We could, and perhaps should, merge them together.
21
template<typename K, typename V>
22
struct OrderedMap
23
{
24
std::vector<K> keys;
25
DenseHashMap<K, V> pairings{nullptr};
26
27
void push(K k, V v)
28
{
29
keys.push_back(k);
30
pairings[k] = v;
31
}
32
};
33
34
} // namespace Luau
35
36