InternPool: replace untyped values with typed values (#1023)

* InternPool: replace untyped values with typed values

* InternPool: remove `indexToTag`

* InternPool: rework representation of optional values

* add representation for unknown values and types

* ComptimeInterpreter: use InternPool typed-values

* ComptimeInterpreter: field access test

* ComptimeInterpreter: improve handling of if expressions

* InternPool: fix typeOf on a comptime float

* ComptimeInterpreter: implement TypeOf with multiple parameters
This commit is contained in:
Techatrix
2023-02-27 22:53:46 +00:00
committed by GitHub
parent 89ab9fdf70
commit 30869d7d87
6 changed files with 707 additions and 605 deletions

View File

@@ -788,6 +788,7 @@ pub fn resolveTypeOfNodeInternal(store: *DocumentStore, node_handle: NodeWithHan
}
return null;
};
const is_type_val = interpreter.ip.indexToKey(value.index).typeOf() == .type_type;
return TypeWithHandle{
.type = .{
@@ -795,7 +796,7 @@ pub fn resolveTypeOfNodeInternal(store: *DocumentStore, node_handle: NodeWithHan
.interpreter = interpreter,
.value = value,
} },
.is_type_val = value.ty == InternPool.Index.type_type,
.is_type_val = is_type_val,
},
.handle = node_handle.handle,
};