Small naming fixes

This commit is contained in:
nub31
2025-08-18 13:30:14 +02:00
parent 130a2f9d78
commit c07dba2fa7
2 changed files with 4 additions and 4 deletions

View File

@@ -182,7 +182,7 @@ public class StructTypeNode(string name, IReadOnlyList<TypeNode> fields, IReadOn
public IReadOnlyList<InterfaceTypeNode> InterfaceImplementations { get; set; } = interfaceImplementations;
public override string ToString() => Name;
public override bool Equals(TypeNode? other) => other is StructTypeNode custom && Name == custom.Name;
public override bool Equals(TypeNode? other) => other is StructTypeNode structType && Name == structType.Name;
public override int GetHashCode() => HashCode.Combine(typeof(StructTypeNode), Name);
}
@@ -192,7 +192,7 @@ public class InterfaceTypeNode(string name, IReadOnlyList<FuncTypeNode> function
public IReadOnlyList<FuncTypeNode> Functions { get; set; } = functions;
public override string ToString() => Name;
public override bool Equals(TypeNode? other) => other is InterfaceTypeNode custom && Name == custom.Name;
public override bool Equals(TypeNode? other) => other is InterfaceTypeNode interfaceType && Name == interfaceType.Name;
public override int GetHashCode() => HashCode.Combine(typeof(InterfaceTypeNode), Name);
}

View File

@@ -55,7 +55,7 @@ public sealed class TypeChecker
ExternFuncSyntax definition => CheckExternFuncDefinition(definition),
InterfaceSyntax definition => CheckInterfaceDefinition(definition),
LocalFuncSyntax definition => CheckLocalFuncDefinition(definition),
StructSyntax definition => CheckStruct(definition),
StructSyntax definition => CheckStructDefinition(definition),
_ => throw new ArgumentOutOfRangeException(nameof(node))
};
}
@@ -72,7 +72,7 @@ public sealed class TypeChecker
return new InterfaceNode(node.Name, functions);
}
private StructNode CheckStruct(StructSyntax node)
private StructNode CheckStructDefinition(StructSyntax node)
{
var structFields = new List<StructFieldNode>();