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

Documentation regarding parsing of ids might be incorrect #1

Open
jcraane opened this issue Sep 23, 2024 · 0 comments
Open

Documentation regarding parsing of ids might be incorrect #1

jcraane opened this issue Sep 23, 2024 · 0 comments

Comments

@jcraane
Copy link

jcraane commented Sep 23, 2024

The documentation regarding parsing ids from prefixed strings (like user_01h455vb4pex5vsknk084sn02q) states it can be parsed with:

val userId: UserId = typeId.parse("user_01h455vb4pex5vsknk084sn02q")

However, if I paste the exact code (where UserId is typealias UserId = Id) it gives s compile time error:

Initializer type mismatch: expected 'UserId', actual 'earth.adi.typeid.RawId'.

I think the example should be (by using the entity User as the type):

val userId3: UserId = typeId.parse("user_01h455vb4pex5vsknk084sn02q")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant