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

Typed Paths #369

Closed
17 tasks done
turbolent opened this issue Sep 10, 2020 · 0 comments · Fixed by #403
Closed
17 tasks done

Typed Paths #369

turbolent opened this issue Sep 10, 2020 · 0 comments · Fixed by #403
Assignees

Comments

@turbolent
Copy link
Member

turbolent commented Sep 10, 2020

Issue To Be Solved

Currently, all paths have the type Path and the getCapability functions accepts an argument of type Path and returns an optional capability if the argument has the correct domain,

However, this run-time check is confusing and can be moved to a static check by typing paths based on domain, and changing the parameter type of the getCapability functions.

Definition of Done

  • Sema:
    • Introduce StoragePath, CapabilityPath, PublicPath, and PrivatePath
    • Make PublicPath, and PrivatePath a subtype of CapabilityPath
    • Change the type of path literals, based on the domain
    • Change the save function to accept a StoragePath
    • Change the load function to accept a StoragePath
    • Change the copy function to accept a StoragePath
    • Change the borrow function to accept a StoragePath
    • Change the link function to accept a CapabilityPath
    • Change the unlink function to accept a CapabilityPath
    • Change the getLinkTarget function to accept a CapabilityPath
    • Change the AuthAccount.getCapability function to accept a CapabilityPath
    • Change the PublicAccount.getCapability function to accept a PublicPath
    • Change the getCapability functions to return a non-optional type
  • Interpreter: Change the getCapability functions to return a non-optional value
  • Tests
  • Documentation
    • Update type hierarchy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants