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