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

incorrect error message with iso assignment #4581

Closed
SeanTAllen opened this issue Jan 6, 2025 · 1 comment
Closed

incorrect error message with iso assignment #4581

SeanTAllen opened this issue Jan 6, 2025 · 1 comment
Labels
bug Something isn't working discuss during sync Should be discussed during an upcoming sync

Comments

@SeanTAllen
Copy link
Member

Unless there's something about the Stead model that I don't understand, I believe that when we switched to the stead model we ended up with an incorrect error message for this code:

actor Main
  new create(env: Env) =>
    let a: String iso = recover iso "hello".clone() end
    let b: String iso = a

The current error is:

main.pony:4:23: right side must be a subtype of left side
    let b: String iso = a
                      ^
    Info:
    main.pony:3:12: String iso is not a subtype of String iso^: iso is not a subcap of iso^
        let a: String iso = recover iso "hello".clone() end
               ^
    main.pony:3:19: this would be possible if the subcap were more ephemeral. Perhaps you meant to consume a variable here
        let a: String iso = recover iso "hello".clone() end

The previous message was:

right side must be a subtype of left side
    let b: String iso = a
                      ^
    Info:
    <source>:3:12: String iso! is not a subtype of String iso: iso! is not a subcap of iso
        let a: String iso = recover iso "hello".clone() end
               ^
    <source>:3:19: this would be possible if the subcap were more ephemeral
        let a: String iso = recover iso "hello".clone() end
           
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jan 6, 2025
@SeanTAllen SeanTAllen added bug Something isn't working and removed discuss during sync Should be discussed during an upcoming sync labels Jan 7, 2025
@SeanTAllen
Copy link
Member Author

We discussed during sync and decided there is no correct answer here so we are leaving as is. And this might be a change in discussion that came from George's paper.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discuss during sync Should be discussed during an upcoming sync
Projects
None yet
Development

No branches or pull requests

2 participants