This commit is contained in:
nub31
2025-10-20 18:34:15 +02:00
parent 28dad76140
commit 66dc26e29e

View File

@@ -889,7 +889,6 @@ public record Variable(string Name, NubType Type, VariableKind Kind);
public class Scope(string module, Scope? parent = null)
{
private readonly List<Variable> _variables = [];
private readonly Dictionary<string, NubType> _typeSubstitutions = [];
public string Module { get; } = module;
public void DeclareVariable(Variable variable)
@@ -908,21 +907,6 @@ public class Scope(string module, Scope? parent = null)
return parent?.LookupVariable(name);
}
public void DeclareTypeSubstitution(string name, NubType type)
{
_typeSubstitutions[name] = type;
}
public NubType? LookupTypeSubstitution(string name)
{
if (_typeSubstitutions.TryGetValue(name, out var type))
{
return type;
}
return parent?.LookupTypeSubstitution(name);
}
public Scope SubScope()
{
return new Scope(Module, this);