Skip to content

section 6.23 of LRM 2017 results in a syntax error #100

Description

@fpgauserdude

The following code produces an error:

package test2;

typedef enum
   {
     UNKNOWN = 0,
     BYTES,
     INT,
     FLOAT
   } type_e;

class Container #(type T);
  typedef T data_t;

  function type_e get_type();
    case (type(T))
      type(byte): return BYTES;
      type(longint): return INT;
      type(real): return FLOAT;
      default: return UNKNOWN;
    endcase // case (type(T))
  endfunction
endclass // Container

endpackage

Error:
$ svinst test2.sv
files:
parse failed: "test2.sv"
test2.sv:11:1
|
11 | class Container #(type T);
| ^

Commenting out the case statement allows the parser to succeed.

This code compiles fine on a commercial parser. See section 6.23 of the 1800-2017 LRM.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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