forked from M-Labs/nac3
nac3core: type inferencer fix the pass statement
This commit is contained in:
parent
df6c9c8a35
commit
1c170f5c41
@ -939,7 +939,7 @@ fn test_analyze(source: Vec<&str>, res: Vec<&str>) {
|
|||||||
indoc! {"
|
indoc! {"
|
||||||
class A:
|
class A:
|
||||||
def fun(self):
|
def fun(self):
|
||||||
1 + 2
|
pass
|
||||||
"},
|
"},
|
||||||
indoc!{"
|
indoc!{"
|
||||||
class B:
|
class B:
|
||||||
|
@ -128,7 +128,7 @@ impl<'a> fold::Fold<()> for Inferencer<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast::StmtKind::AnnAssign { .. } | ast::StmtKind::Expr { .. } => {}
|
ast::StmtKind::AnnAssign { .. } | ast::StmtKind::Expr { .. } => {}
|
||||||
ast::StmtKind::Break | ast::StmtKind::Continue => {}
|
ast::StmtKind::Break | ast::StmtKind::Continue | ast::StmtKind::Pass => {}
|
||||||
ast::StmtKind::Return { value } => match (value, self.function_data.return_type) {
|
ast::StmtKind::Return { value } => match (value, self.function_data.return_type) {
|
||||||
(Some(v), Some(v1)) => {
|
(Some(v), Some(v1)) => {
|
||||||
self.unify(v.custom.unwrap(), v1, &v.location)?;
|
self.unify(v.custom.unwrap(), v1, &v.location)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user