-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fix a warning when there are only enums, no messages. #370
Conversation
Previously we got: ``` ...../build/enum_test/autogen/Proto/EnumOnly.hs:72:1: error: [-Wunused-top-binds, -Werror=unused-top-binds] Defined but not used: ‘packedFileDescriptor’ | 72 | packedFileDescriptor | ^^^^^^^^^^^^^^^^^^^^ ``` The check for whether the file had any messages was incorrect, since it didn't account for enums which are tracked in the same map.
@@ -163,3 +165,5 @@ testAliases = testCase "alias" $ do | |||
|
|||
testManyCases = | |||
runTypedTest (roundTripTest "many cases" :: TypedTest ManyCasesProto) | |||
|
|||
testLone = testCase "no messages" $ LONE @?= LONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this test. Isn't LONE
always == LONE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment. The test is intentionally trivial; the goal is just to make this file import the other module to make sure it compiles properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks for the comment.
@@ -163,3 +165,5 @@ testAliases = testCase "alias" $ do | |||
|
|||
testManyCases = | |||
runTypedTest (roundTripTest "many cases" :: TypedTest ManyCasesProto) | |||
|
|||
testLone = testCase "no messages" $ LONE @?= LONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks for the comment.
Previously we got: ``` ...../build/enum_test/autogen/Proto/EnumOnly.hs:72:1: error: [-Wunused-top-binds, -Werror=unused-top-binds] Defined but not used: ‘packedFileDescriptor’ | 72 | packedFileDescriptor | ^^^^^^^^^^^^^^^^^^^^ ``` The check for whether the file had any messages was incorrect, since it didn't account for enums which are tracked in the same map.
Previously we got:
The check for whether the file had any messages was incorrect, since it didn't account for enums which are tracked in the same map.