-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit special warning when = is used and user might want to use <- (#1115
) * Emit special warning when = is used and user might want to use <- * Don't warn if there is no setter * Move IsPropertyGetter and IsPropertySetter to tast.fs * Show property name in error message * Use IsPropertyGetterMethod/IsPropertySetterMethod in Symbols.fs * Only warn on last expression in a sequence - fixes #326 * Extract ReportImplicitlyIgnoredBoolExpression as separate function * Detect "in" expressions
- Loading branch information
Showing
18 changed files
with
210 additions
and
48 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
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
2 changes: 1 addition & 1 deletion
2
...ource/Conformance/Expressions/DataExpressions/QueryExpressions/E_WhereRequiresParens01.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
14 changes: 14 additions & 0 deletions
14
tests/fsharpqa/Source/Warnings/DontWarnIfPropertyWithoutSetter.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,14 @@ | ||
// #Warnings | ||
//<Expects status="Warning" span="(11,5)" id="FS0020">The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'.</Expects> | ||
|
||
type MyClass(property1 : int) = | ||
member val Property2 = "" with get | ||
|
||
let x = MyClass(1) | ||
let y = "hello" | ||
|
||
let changeProperty() = | ||
x.Property2 = "22" | ||
y = "test" | ||
|
||
exit 0 |
11 changes: 11 additions & 0 deletions
11
tests/fsharpqa/Source/Warnings/WarnIfImplicitlyDiscarded.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,11 @@ | ||
// #Warnings | ||
//<Expects status="Warning" span="(8,5)" id="FS0020">The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'.</Expects> | ||
|
||
let x = 10 | ||
let y = 20 | ||
|
||
let changeX() = | ||
y * x = 20 | ||
y = 30 | ||
|
||
exit 0 |
Oops, something went wrong.