This commit is contained in:
nub31
2026-02-10 22:26:18 +01:00
parent d0c31ad17f
commit 576abe1240
12 changed files with 308 additions and 26 deletions

View File

@@ -5,6 +5,7 @@ namespace Compiler;
public abstract class NubType
{
public abstract override string ToString();
public string GetSignature() => TypeMangler.Encode(this);
}
public sealed class NubTypeVoid : NubType
@@ -214,7 +215,7 @@ static class TypeMangler
break;
case NubTypeStruct st:
sb.Append($"T({st.Module}::{st.Name})").Append(st.Module).Append("::").Append(st.Name).Append(')');
sb.Append($"T({st.Module}::{st.Name})");
break;
case NubTypeFunc fn:
@@ -239,7 +240,7 @@ static class Hashing
public static ulong Fnv1a64(string text)
{
const ulong offset = 14695981039346656037UL;
const ulong prime = 1099511628211UL;
const ulong prime = 1099511628211UL;
ulong hash = offset;
foreach (var c in Encoding.UTF8.GetBytes(text))