FSAC0002 incorrectly tagged on nullable join clause in query expression
In Ionide, the redundant qualifier tip (FSAC0002) is tagged on the first identifier when joining on a nullable property in a query expression. For example, if table1.column1 is of type int and table2.column2 is of type Nullable<int>, the following code snipped gets the FSAC0002 tip on row1 in row1.column1 =? row2.column2.
query {
for row1 in table1 do
join row2 in table2 on (row1.column1 =? row2.column2)
select (row1, row2)
}
Here, the row1 identifier is actually not redundant and will break the code if removed. Interestingly, this only seems to happen when using the =? operator. If you write the same line with the condition as row1.column1 = row2.column2.value, no tool tip is shown.
thanks for the detailed report! Do you by any chance have some kind of self-contained sample that we could use to test/investigate with?
Sure. Below is a code snippet that I can reproduce it with in an fsx file:
open System
open Microsoft.FSharp.Linq.NullableOperators
let table1 = [ for i in 0 .. 10 -> {| Column1 = i |} ]
let table2 = [ for i in 0 .. 10 -> {| Column2 = Nullable<int> i |} ]
query {
for row1 in table1 do
join row2 in table2 on (row1.Column1 =? row2.Column2)
select (row1, row2)
}
And a screenshot of the tool tip generated:

This is coming from FCS, we'd need this to be investigated and fixed upstream before it can work here. FSharp.Compiler.EditorServices.SimplifyNames.getSimplifiableNames says that row1.Column1 can be simplified, and we just report that.