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

extern declarations cause "Bad usage of failwith:" warning #561

Closed
webwarrior-ws opened this issue Aug 1, 2022 · 0 comments · Fixed by #562
Closed

extern declarations cause "Bad usage of failwith:" warning #561

webwarrior-ws opened this issue Aug 1, 2022 · 0 comments · Fixed by #562

Comments

@webwarrior-ws
Copy link
Contributor

webwarrior-ws commented Aug 1, 2022

Description

extern declarations cause "Bad usage of failwith:" warning

Repro steps

Run linter against code:

[<DllImport("LogitechLedEnginesWrapper", CallingConvention=CallingConvention.Cdecl)>]
extern bool LogiLedInit()

[<DllImport("LogitechLedEnginesWrapper", CallingConvention=CallingConvention.Cdecl)>]
extern bool LogiLedSetLighting(int redPercenatge, int greenPercenatge, int bluePercenatge)

Note: must be at least 2 extern declarations

Expected behavior

No errors or warnigns.

Actual behavior

The following warning is issued:

Bad usage of failwith: consider using unique error messages as parameters.
Error on line 5 starting at column 0
extern bool LogiLedSetLighting(int redPercenatge, int greenPercenatge, int bluePercenatge)
^
webwarrior-ws added a commit to webwarrior-ws/FSharpLint that referenced this issue Aug 1, 2022
webwarrior-ws added a commit to webwarrior-ws/FSharpLint that referenced this issue Aug 1, 2022
Ignore certain message auto-generated by F# compiler in place of "extern" declarations.
Fixes fsprojects#561
webwarrior-ws added a commit to webwarrior-ws/FSharpLint that referenced this issue Aug 1, 2022
This time test case is for multiple extern declarations, but without DllImport attribute
See issue fsprojects#561
knocte pushed a commit that referenced this issue Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant