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

Support subset of instances of nested abstract clafers #29

Closed
mantkiew opened this issue Sep 5, 2016 · 2 comments
Closed

Support subset of instances of nested abstract clafers #29

mantkiew opened this issue Sep 5, 2016 · 2 comments
Assignees
Milestone

Comments

@mantkiew
Copy link
Member

@mantkiew mantkiew commented Sep 5, 2016

The following example gives a NullPointerException:

abstract Component
    abstract Port
    abstract ExceptionPort : Port
    allPorts -> Port *
    [ allPorts.dref = this.Port ]    // the exception is caused by "this.Port"

WinController : Component
    cmd : Port
    powerOut : ExceptionPort

The expected output is (as produced by AlloyIG):

WinController
  allPorts$1 -> powerOut
  allPorts$2 -> cmd
  powerOut
  cmd

This works nicely for concrete clafers:

Component 3
    Port 1..3
    allPorts -> Port *
    [ allPorts.dref = this.Port ]

produces, for example an instance:

Component
  Port
  Port$1
  allPorts -> Port
  allPorts$1 -> Port$1
Component$1
  Port$2
  Port$3
  allPorts$2 -> Port$2
  allPorts$3 -> Port$3
Component$2
  Port$4
  Port$5
  allPorts$4 -> Port$5
  allPorts$5 -> Port$4
@mantkiew mantkiew added this to the 0.4.4 milestone Sep 5, 2016
mantkiew added a commit that referenced this issue Sep 5, 2016
@mantkiew
Copy link
Member Author

@mantkiew mantkiew commented Sep 5, 2016

It's a peculiar bug because the following works fine

abstract Component
    abstract Port
//    abstract ExceptionPort : Port
    allPorts -> Port *
    [ allPorts.dref = this.Port ]

WinController : Component
    cmd : Port
    powerOut : Port //ExceptionPort
@JLiangWaterloo
Copy link
Member

@JLiangWaterloo JLiangWaterloo commented Sep 7, 2016

Fixed.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.