add Hash to morphism type
This commit is contained in:
parent
403aede376
commit
0718da96c0
3 changed files with 6 additions and 6 deletions
|
@ -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,
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue