typing: cleanup imports and fix unit in return
This commit is contained in:
parent
1b91ee53d4
commit
78b20f3603
1 changed files with 5 additions and 10 deletions
|
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue