Skip to content

-dparsed produces invalid BSV module function that takes another module as an argument #663

Open
@RyanGlScott

Description

@RyanGlScott

Given this BSV code:

package Foo;

module [Module] helloWorld#(Module#(Empty) m)(Empty);
  let e <- m;
endmodule

endpackage

Compiling it with bsc -dparsed=FooParsed.bsv Foo.bsv yields:

package Foo;
module helloWorld#(Module#(Empty) m)(Empty);
  let e <- m;
endmodule: helloWorld

endpackage: Foo

This is almost the same code, but there is one key difference: the module keyword lacks the [Module] part after it. This change is significant enough to cause bsc to reject it:

$ bsc FooParsed.bsv 
Warning: Unknown position: (S0001)
  File name `FooParsed.bsv' does not match package name `Foo'
Error: "FooParsed.bsv", line 2, column 8: (T0029)
  Signature mismatch (given too general):
  given:
  function a__#(Empty) f(Module#(Empty) x1)   provisos (IsModule#(a__, b__))
  deduced:
  module f#(Module#(Empty) x1)(Empty)   provisos (IsModule#(Module, Id__))

Any reason not to preserve the [Module] part?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions