summaryrefslogtreecommitdiff
path: root/src/semantic
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2017-11-06 09:26:23 -0500
committerDavid Li <li.davidm96@gmail.com>2017-11-06 09:26:23 -0500
commit5b137e0983051bf72759cea9c4af1c4bc7a24e1f (patch)
treeb1ef7efe6dbacbe3f37275fd829c8cc9eb19551c /src/semantic
parente4dfafc26756b6e9fe3df445efb5a14d4cab3e31 (diff)
Type check record definitions
Diffstat (limited to 'src/semantic')
-rw-r--r--src/semantic/translate.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/semantic/translate.rs b/src/semantic/translate.rs
index 6c7f60c..dfcec68 100644
--- a/src/semantic/translate.rs
+++ b/src/semantic/translate.rs
@@ -43,14 +43,13 @@ fn trans_ty<'a>(
trans_ty(venv, tenv, &inner_ty)
},
ast::Ty::Record(ref fields) => {
- err!(ty, TypeError::Unimplemented)
- // let result = vec![];
- // for field in fields {
- // result.push(types::RecordField::new(
- // *field.name,
- // trans_ty(venv, tenv, field.ty)?));
- // }
- // Ok(Ty::Record(result))
+ let mut result = vec![];
+ for field in fields {
+ result.push(types::RecordField::new(
+ field.name.clone(),
+ trans_ty(venv, tenv, &field.ty)?));
+ }
+ Ok(Ty::Record(result))
},
}
}