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

Non-sendable data seen as sendable #4459

Open
SeanTAllen opened this issue Oct 6, 2023 · 0 comments
Open

Non-sendable data seen as sendable #4459

SeanTAllen opened this issue Oct 6, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed needs investigation This needs to be looked into before its "ready for work" triggers release Major issue that when fixed, results in an "emergency" release
Milestone

Comments

@SeanTAllen
Copy link
Member

In fixing a "more likely" error in recover code logic where non-sendable code was allowed to be used in a recover block (#4458), the straightforward fix introduced an issue where generic code that was previously correctly rejected for not being sendable is no longer rejected. Fortunately a later issue catches the code, but the error message is not at all helpful as it should have been caught at the sendability check.

We need to fix this case as well. @jasoncarr0 believes this will be a good amount of work, but more investigation is needed.

class A
class Bad[T]
  let _t: T! // We could also use T: Any #alias but that's more internal 
  new create(t: T!) =>
    this._t = t

  fun bad(): val->(T!) =>
    recover
      this._t    // has type this->(T!)
    end

actor Main
  new create(env: Env) =>
    let a: A ref = A
    let a_val: A val = Bad[A ref](a).bad()

Note the equivalent reified code is correctly marked as being a usage of non-sendable data

class A
class Bad
  let _t: A ref! // We could also use T: Any #alias but that's more internal
  new create(t: A ref!) =>
    this._t = t

  fun bad(): val->(A ref!) =>
    recover
      this._t    // has type this->(T!)
    end

actor Main
  new create(env: Env) =>
    let a: A ref = A
    let a_val: A val = Bad(a).bad()
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Oct 6, 2023
@SeanTAllen SeanTAllen added help wanted Extra attention is needed bug Something isn't working needs investigation This needs to be looked into before its "ready for work" and removed discuss during sync Should be discussed during an upcoming sync labels Oct 6, 2023
@SeanTAllen SeanTAllen added the triggers release Major issue that when fixed, results in an "emergency" release label Oct 29, 2023
@SeanTAllen SeanTAllen added this to the V1 milestone Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed needs investigation This needs to be looked into before its "ready for work" triggers release Major issue that when fixed, results in an "emergency" release
Projects
None yet
Development

No branches or pull requests

2 participants