FSharpLint icon indicating copy to clipboard operation
FSharpLint copied to clipboard

extern declarations cause "Bad usage of failwith:" warning

Open webwarrior-ws opened this issue 3 years ago • 0 comments

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 avatar Aug 01 '22 11:08 webwarrior-ws