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 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 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

Fixed.

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

2 participants