add Hash to morphism type

This commit is contained in:
Michael Sippel 2025-05-22 01:06:37 +02:00
parent 403aede376
commit 0718da96c0
Signed by: senvas
GPG key ID: F96CF119C34B64A6
3 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@ pub struct ConstraintError {
pub t2: TypeTerm
}
#[derive(Clone)]
#[derive(Clone, Eq, PartialEq, Debug, Hash)]
pub struct ConstraintPair {
pub addr: Vec<usize>,
pub lhs: TypeTerm,

View file

@ -8,7 +8,7 @@ use {
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>\\
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct MorphismType {
pub src_type: TypeTerm,
pub dst_type: TypeTerm
@ -151,7 +151,7 @@ impl MorphismType {
}
}
MorphismType {
MorphismType {
src_type: TypeTerm::Enum{ enum_repr: enum_repr_lhs.clone(), variants: rl },
dst_type: TypeTerm::Enum { enum_repr: enum_repr_rhs.clone(), variants: rr }
}

View file

@ -2,19 +2,19 @@ use {
crate::{parser::ParseLadderType, subtype_unify, DesugaredTypeTerm, TypeDict, TypeID}
};
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub struct StructMember {
pub symbol: String,
pub ty: TypeTerm
}
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub struct EnumVariant {
pub symbol: String,
pub ty: TypeTerm
}
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub enum TypeTerm {
TypeID(TypeID),
Num(i64),