You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not uncommon to define structs where one of the fields is supposed to be a type id for some other type, but afaik there's currently no way in the schema language to just say "use the id of this type" in a constant definition. This affects Sandstorm's powerbox requests, since if they are generated from schema files they end up looking like this:
const descriptor :Powerbox.PowerboxDescriptor = (
tags = [
(
id = 0xc879e379c625cdc7,
# The type id for ApiSession.
value = .tagValue
),
],
);
Developers shouldn't have to look up and insert the magic constant themselves. Ideally you could just write:
const descriptor :Powerbox.PowerboxDescriptor = (
tags = [
(
id = ApiSession,
value = .tagValue
),
],
);
i.e, if a type name is used in a context where a value is expected, treat is as the type id of that name.
The text was updated successfully, but these errors were encountered:
I'd use an intrinsic function like typeId(ApiSession), but otherwise I agree this would be very useful.
(Or, another alternative might be to introduce a TypeId built-in type, which is encoded like UInt64, but uses type names as its literal values. But that'd be more complicated to implement.)
It's not uncommon to define structs where one of the fields is supposed to be a type id for some other type, but afaik there's currently no way in the schema language to just say "use the id of this type" in a constant definition. This affects Sandstorm's powerbox requests, since if they are generated from schema files they end up looking like this:
Developers shouldn't have to look up and insert the magic constant themselves. Ideally you could just write:
i.e, if a type name is used in a context where a value is expected, treat is as the type id of that name.
The text was updated successfully, but these errors were encountered: