typing: cleanup imports and fix unit in return
This commit is contained in:
@@ -1,15 +1,10 @@
|
|||||||
|
mod error;
|
||||||
|
|
||||||
|
use crate::ast::*;
|
||||||
|
use crate::typing::error::{TypeAndSpan, TypeError, TypeErrorKind};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
||||||
use BinaryExpression;
|
|
||||||
use ReturnStatement;
|
|
||||||
|
|
||||||
use crate::ast::ModulePath;
|
|
||||||
use crate::ast::*;
|
|
||||||
|
|
||||||
mod error;
|
|
||||||
use crate::typing::error::{TypeAndSpan, TypeError, TypeErrorKind};
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
@@ -178,7 +173,7 @@ impl TypeCheck for FunctionDefinition {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(self.return_type.clone().unwrap())
|
Ok(self.return_type.clone().unwrap_or(Type::Unit))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user