dotnet / dotnet/fsharp

FS-1093 op_Implicit 3395 warnings missing for constructors and potentially inconsistent

Open
#13,437 4 comments 0 reactions 0 assignees View on GitHub
Area-Compiler-Checking Area-Compiler-Checking-Overloads Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

Take the following example. Compiled with ` $(OtherFlags) --warnon:3395` it produces no warnings on the constructor.

```fs
open System

// Minimized copy for demonstration of Microsoft.Extensions.Primitives.StringValues
type StringValues(v: string) =
static member op_Implicit(values: StringValues): string = ""

type Foo(_v: Nullable) =
member val Test: Nullable = 0 with get,set // Warning for 3391 as I would have interpreted it.
member val StringValue: string = "" with get,set

static member Create() =
let value = 1
let instance = Foo(value, Test = value) // No warning on either the argument or the property setter?
instance.Test <- value // No warning for 3395 and 3391?
instance.StringValue <- StringValues("1") // Warning for 3395

let mutable test: Nullable = value // Warning for 3391 as I would have interpreted it.

// Warning for 3391 but it's syntactically identical to the line that had no warning and one that had 3395???
test <- 1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.