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

print a meaninful error when string enums are used #83

Open
smola opened this issue May 16, 2017 · 0 comments
Open

print a meaninful error when string enums are used #83

smola opened this issue May 16, 2017 · 0 comments

Comments

@smola
Copy link

smola commented May 16, 2017

When a string type is used as a enum-like, proteus does generate code, but that code is invalid and fails to build.

For example:

➜  server git:(initial-version) ✗ go build ./cmd/bblfsh/...
# github.com/bblfsh/sdk/protocol
../sdk/protocol/generated.pb.go:233: cannot convert 0 to type Status
../sdk/protocol/generated.pb.go:233: invalid operation: m.Status != 0 (mismatched types Status and int)
../sdk/protocol/generated.pb.go:236: cannot convert m.Status (type Status) to type uint64
../sdk/protocol/generated.pb.go:305: cannot convert 0 to type Status
../sdk/protocol/generated.pb.go:305: invalid operation: m.Status != 0 (mismatched types Status and int)
../sdk/protocol/generated.pb.go:308: cannot convert m.Status (type Status) to type uint64
../sdk/protocol/generated.pb.go:378: cannot convert 0 to type Status
../sdk/protocol/generated.pb.go:378: invalid operation: m.Status != 0 (mismatched types Status and int)
../sdk/protocol/generated.pb.go:379: cannot convert m.Status (type Status) to type uint64
../sdk/protocol/generated.pb.go:407: cannot convert 0 to type Status
../sdk/protocol/generated.pb.go:407: too many errors

I saw it is actually documented in the README.md, but it would still be good to give an error or a warning when calling proteus.

@smola smola changed the title proteus does not print a meaninful error when string enums are used print a meaninful error when string enums are used May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants