use layout first to determine if something is a closure

This commit is contained in:
Folkert 2020-10-18 23:04:28 +02:00
parent a88f78d6b7
commit 7b4e87a671
2 changed files with 94 additions and 36 deletions

View file

@ -649,7 +649,10 @@ fn layout_from_flat_type<'a>(
use roc_types::types::RecordField::*;
match field {
Optional(_) => {
// optional values are not available at this point
// when an optional field reaches this stage, the field was truly
// optional, and not unified to be demanded or required
// therefore, there is no such field on the record, and we ignore this
// field from now on.
continue;
}
Required(var) => var,