Open kaleidawave opened 9 months ago
Quite happy with how PropertyValue
is now. Probably 90% done
/// TODO getter, setting need a closure id
#[derive(Clone, Debug, binary_serialize_derive::BinarySerializable)]
pub enum PropertyValue {
Value(TypeId),
Getter(Box<FunctionType>),
Setter(Box<FunctionType>),
/// TODO doesn't exist Deleted | Optional
Deleted,
ConditionallyExists {
on: TypeId,
truthy: Box<Self>,
},
}
Currently there is no difference in the representation of properties that are dependent once OR multiple times.
aka
{ [a: number]: "value" }
has under a context properties as[(PropertyKey::Type(*number type*), Property::Value(TypeId -> Type::Constant(Constant::String("value")))]
. There is no difference between this being a project with many keys that are number like OR a single key, which is of the type of number.I think this can be solved by a separate variant
Property
on the RHS calledProperty::Multiple(Box<Property>)
which denotes that the RHS property is dependent. This only makes sense if the LHS isPropertyKey::Type
though 🤔. Also the RHS needs depend of types from the LHS for type mappings in TypeScript 🤔🤔