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

Fix reachability analysis for intersection types #2106

Merged
merged 1 commit into from
Jul 29, 2017

Conversation

Praetonus
Copy link
Member

This change fixes a bug where methods on members of intersection types sometimes weren't being reached.

Closes #2102.

I haven't been able to produce a minimal test case for the bug.

This change fixes a bug where methods on members of intersection types
sometimes weren't being reached.

Closes ponylang#2102.
@SeanTAllen SeanTAllen mentioned this pull request Jul 29, 2017
@Praetonus Praetonus added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Jul 29, 2017
@jemc
Copy link
Member

jemc commented Jul 29, 2017

This is only waiting on one of the OSX builds - all other Travis builds have passed. The remaining build seems to be Travis-stalled, so I'm going to go ahead and merge.

Bummer about not having a minimal repro, but it's great that you found a fix so quickly.

@jemc jemc merged commit 6b5c665 into ponylang:master Jul 29, 2017
ponylang-main added a commit that referenced this pull request Jul 29, 2017
@Praetonus Praetonus deleted the fix-2102 branch July 29, 2017 19:56
@dipinhora
Copy link
Contributor

@Praetonus Minimal case:

use "debug"

actor Main
  var _p: (P | None) = None
  var _env: Env
  
  new create(env: Env) =>
    _env = env
    create_p()
    run_p()
  
  be create_p() =>
    let v = V
    _p = P(v)
  
  be run_p() =>
    try
      (_p as P).run()
    end

trait C

trait E
  be fun_p() => None

actor P
  var _r: R tag
  
  new create(r: R tag) =>
    _r = r
  
  be run() =>
    _r.fun_p()

type R is (C tag & E tag)

actor V is (C & E)
  new create() => 
    Debug.out("V created")

Tested against commit b1a5cf32be86a516cd58b920a76db1475c67ceee. This prints out "V created" twice. Passing env to V.create() causes a segfault on the second invocation of create. Changing the var _p: (P | None) = None to be var _p: P and assigning directly in the constructor makes the issue go away. As does combining the two behaviors in Main together. Same with changing V to only have one is instead of two.

@SeanTAllen
Copy link
Member

Sounds like another release is coming

@dipinhora
Copy link
Contributor

@SeanTAllen Why? That commit is from right after 0.16.0.

@SeanTAllen
Copy link
Member

We already released 0.16.1

@dipinhora
Copy link
Contributor

Yes. The minimal case is for @Praetonus since he wasn't able to create one when fixing the issue. I had assumed the desire for one was to be able to include it as part of the automated testing.

@SeanTAllen
Copy link
Member

O I thought this was a new bug. Nice. Sorry, I didn't understand what you were saying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug - actor constructor called multiple times when invoking behavior
4 participants