-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue warning for additional unused arguments of 'raise'-family funct…
…ions closes #630 fixes #46 commit 45c8e02 Author: Anh-Dung Phan <[email protected]> Date: Fri Sep 11 21:34:52 2015 +0000 Add relevant unit tests commit 91b45f2 Author: Anh-Dung Phan <[email protected]> Date: Fri Sep 11 20:51:46 2015 +0000 Fix compiler warnings exposed by the feature commit 9fd0610 Author: dungpa <[email protected]> Date: Mon Sep 7 01:07:28 2015 +0200 Add warnings for extra arguments of failwithf function commit 4794492 Author: dungpa <[email protected]> Date: Sun Sep 6 00:25:58 2015 +0200 Add similar warnings for failwith, invalidArg, nullArg and invalidOp commit a23e312 Author: dungpa <[email protected]> Date: Sat Sep 5 23:49:54 2015 +0200 Check number of arguments of function 'raise'
- Loading branch information
Showing
17 changed files
with
138 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
tests/fsharpqa/Source/Diagnostics/General/W_FailwithRedundantArgs.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// #Regression #Diagnostics | ||
//<Expects status="warning" span="(4,11-4,19)" id="FS3189">Redundant arguments are being ignored in function 'failwith'\. Expected 1 but got 2 arguments\.$</Expects> | ||
module M | ||
let f() = failwith "Used" "Ignored" | ||
let g() = failwith "Used" |
8 changes: 8 additions & 0 deletions
8
tests/fsharpqa/Source/Diagnostics/General/W_FailwithfRedundantArgs.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// #Regression #Diagnostics | ||
//<Expects status="warning" span="(4,11-4,20)" id="FS3189">Redundant arguments are being ignored in function 'failwithf'\. Expected 3 but got 4 arguments\.$</Expects> | ||
module M | ||
let f() = failwithf "Used %A %s" "this" "but not" "this" | ||
let g() = failwith "Used %A" "this" | ||
let h() = | ||
let failwithf arg = Printf.ksprintf failwith arg | ||
failwithf "Used" "Ignored" |
8 changes: 8 additions & 0 deletions
8
tests/fsharpqa/Source/Diagnostics/General/W_InvalidArgRedundantArgs.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// #Regression #Diagnostics | ||
//<Expects status="warning" span="(6,5-6,15)" id="FS3189">Redundant arguments are being ignored in function 'invalidArg'\. Expected 2 but got 3 arguments\.$</Expects> | ||
module M | ||
type T() = | ||
member __.M1 source = | ||
invalidArg source "Used" "Ignored" | ||
member __.M2 source = | ||
invalidArg source "Used" |
7 changes: 7 additions & 0 deletions
7
tests/fsharpqa/Source/Diagnostics/General/W_InvalidOpRedundantArgs.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// #Regression #Diagnostics | ||
//<Expects status="warning" span="(6,20-6,29)" id="FS3189">Redundant arguments are being ignored in function 'invalidOp'\. Expected 1 but got 2 arguments\.$</Expects> | ||
namespace M0 | ||
module M1 = | ||
module M2 = | ||
let f source = invalidOp source "Ignored" | ||
let g source = invalidOp source |
7 changes: 7 additions & 0 deletions
7
tests/fsharpqa/Source/Diagnostics/General/W_NullArgRedundantArgs.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// #Regression #Diagnostics | ||
//<Expects status="warning" span="(6,17-6,24)" id="FS3189">Redundant arguments are being ignored in function 'nullArg'\. Expected 1 but got 2 arguments\.$</Expects> | ||
namespace M0 | ||
module M1 = | ||
module M2 = | ||
let f arg = nullArg "arg" "Ignored" | ||
let g arg = nullArg "arg" |
8 changes: 8 additions & 0 deletions
8
tests/fsharpqa/Source/Diagnostics/General/W_RaiseRedundantArgs.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// #Regression #Diagnostics | ||
//<Expects status="warning" span="(6,5-6,10)" id="FS3189">Redundant arguments are being ignored in function 'raise'\. Expected 1 but got 2 arguments\.$</Expects> | ||
module M | ||
type T() = | ||
member __.M1() = | ||
raise (exn()) "Ignored" | ||
member __.M2() = | ||
raise (exn()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters