Skip to content

mtype subtype checking fails when read to fields in typedef #70

@liuzikai

Description

@liuzikai

For example,

mtype:Symbol = { SYM_A, SYM_B }

typedef St {
  mtype:Symbol sym;
};

chan Channel = [0] of { mtype:Symbol };

proctype Bar() {
  St s;
  Channel ? s.sym;
}

(The code piece is incomplete. It's cherry-picked from a large codebase.)

When running spin on it, it complains:

Error: 's' is type '_unnamed_', but should be type 'Symbol'
Error: incorrect type of 's'

I think spin should check the type of s.sym rather than s? Or do I understand mtype subtyping wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions