Kill some unused items
This commit is contained in:
parent
b35262c444
commit
95fe1941a1
@ -3,7 +3,6 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::tokenizing::TokenKind;
|
||||
use crate::typechecking::{TypeConst, Type};
|
||||
use crate::typechecking::TypeConst::*;
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub struct BinOp {
|
||||
|
@ -55,7 +55,7 @@ impl fmt::Display for SymbolSpec {
|
||||
match self {
|
||||
Func(type_names) => write!(f, "Func({:?})", type_names),
|
||||
DataConstructor { index, type_name, type_args } => write!(f, "DataConstructor(idx: {})({:?} -> {})", index, type_args, type_name),
|
||||
RecordConstructor { fields } => write!(f, "RecordConstructor( <fields> )"),
|
||||
RecordConstructor { fields: _fields } => write!(f, "RecordConstructor( <fields> )"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -130,7 +130,7 @@ impl SymbolTable {
|
||||
},
|
||||
//TODO if there is only one variant, and it is a record, it doesn't need to have an
|
||||
//explicit name
|
||||
Variant::Record { name, members } => {
|
||||
Variant::Record { name, members: _members } => {
|
||||
let fields = HashMap::new();
|
||||
let spec = SymbolSpec::RecordConstructor { fields };
|
||||
let symbol = Symbol { name: name.clone(), spec };
|
||||
|
@ -335,7 +335,7 @@ impl<'a> TypeContext<'a> {
|
||||
}
|
||||
|
||||
fn unify(&mut self, t1: Type, t2: Type) -> InferResult<Type> {
|
||||
use self::Type::*; use self::TypeConst::*;
|
||||
use self::Type::*;
|
||||
Ok(match (t1, t2) {
|
||||
(Const(ref c1), Const(ref c2)) if c1 == c2 => Const(c1.clone()), //choice of c1 is arbitrary I *think*
|
||||
(a, b) => return TypeError::new(format!("{:?} and {:?} do not unify", a, b)),
|
||||
|
Loading…
Reference in New Issue
Block a user