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

Is "use" statement functional? #55

Open
brjohnsn opened this issue Apr 1, 2018 · 1 comment
Open

Is "use" statement functional? #55

brjohnsn opened this issue Apr 1, 2018 · 1 comment
Assignees
Labels

Comments

@brjohnsn
Copy link

brjohnsn commented Apr 1, 2018

I'm attempting to 'use' the types from one RDL file in another one. An example of what I'm doing follows:

File: .../example/used/used.rdl

name used
type AStruct struct {
  int64 AValue
}

File: .../example/user/user.rdl

name user
use "../used/used.rdl"
resource used.AStruct GET "/example" {
  expected OK;
  exceptions {
    ResourceError NOT_FOUND; // No entry found
  }
}

When I attempt to generate any Go code for the user.rdl file I receive a warning and the Go code generated does not build. When I attempt to generate Markdown I get an error from the rdl tool. Issuing an rdl parse command on the user.rdl file returns no errors. Am I doing something wrong or is this a bug? If I replace the use keyword in the user.rdl file with the include keyword and remove the used. prefix from AStruct, generation succeeds in all cases. However a completely new type is then generated in the user package that is no longer the same as used.AStruct.

@boynton
Copy link
Collaborator

boynton commented Jun 2, 2018

This must be broken. The "use" directive was originally intended for the special references to RDL types themselves, tests and fixes are needed for the use case you describe.

@boynton boynton added the bug label Jun 2, 2018
@boynton boynton self-assigned this Jun 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants