Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type system function: type_spec_is_assignable_to, and applying them to ABI value set method #583

Open
ahangsu opened this issue Oct 24, 2022 · 0 comments
Labels
new-feature-request Feature request that needs triage Team Scytale

Comments

@ahangsu
Copy link
Contributor

ahangsu commented Oct 24, 2022

Problem

Under this thread of discussion: #567 (comment), as we are applying type_spec_is_assignable_to over ABI value set method, this brings question on ABI value inheritance hierarchy and type system design, for example:

  • address should be less generic than byte[32], but the set method allows for setting from byte static array.
    • removing the allowance for StaticBytes brings backwards incompatibility
    • allowing setting from StaticBytes bypasses the type system, breaking soundness of type system
  • NamedTuple should be narrower (more specific) than Tuple, but NamedTuple inherits from Tuple.

This brings some thinking about what we need to do to reconstruct the inherit hierarchy.

Solution

🤔... nondeterminstically thinking

Dependencies

The merge of PR #567 lays the ground of construction.

There are some experimental work in PR #567 and #580 to see what would be the impact of applying "type system" over ABI value assignment, but they went stale after we realized that more efforts needed.

Urgency

Low? For type_spec_is_assignable_to is applied for some bug fixes, but definitely good to have relaxed version of ABI value assigning, rather than exact type-spec equivalence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Scytale
Projects
None yet
Development

No branches or pull requests

2 participants