Skip to content

Commit 6e6833a

Browse files
Add regression test: #4473, extern function parameters not flagged as unused (#19580)
Fixes #4473 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f325ba2 commit 6e6833a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,19 @@ let main _argv =
277277
"""
278278
|> typecheck
279279
|> shouldSucceed
280+
281+
// https://github.com/dotnet/fsharp/issues/4473
282+
[<Fact>]
283+
let ``Issue 4473 - extern function parameters not flagged as unused with warnon 1182``() =
284+
FSharp """
285+
module Test4473
286+
287+
open System.Runtime.InteropServices
288+
289+
[<DllImport("kernel32.dll")>]
290+
extern bool Beep(int frequency, int duration)
291+
"""
292+
|> withWarnOn 1182
293+
|> asLibrary
294+
|> typecheck
295+
|> shouldSucceed

0 commit comments

Comments
 (0)