wip canonicalize case

This commit is contained in:
Richard Feldman 2019-11-03 20:24:34 +01:00
parent d8e0e77110
commit 09c7d75f0d
3 changed files with 145 additions and 62 deletions

View file

@ -111,6 +111,7 @@ pub struct OperatorType {
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Expected<T> {
NoExpectation(T),
FromAnnotation(String, usize, AnnotationSource, T),
ForReason(Reason, T, Region),
}
@ -123,6 +124,13 @@ impl<T> Expected<T> {
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AnnotationSource {
TypedIfBranch(usize /* index */),
TypedCaseBranch(usize /* index */),
TypedBody,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Reason {
AnonymousFnArg(u8 /* arg index */),