You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -243,6 +243,26 @@ let test() =
243
243
M.A(Result<int, string>.Ok 3)
244
244
"""
245
245
246
+
247
+
[<Test>]
248
+
let``Overloading on System.Nullable and Result produces a builtin conversion warning when Nullable is picked``()=
249
+
CompilerAssert.TypeCheckSingleErrorWithOptions
250
+
[|"--warnon:3389"|]
251
+
"""
252
+
module Test
253
+
254
+
type M() =
255
+
static member A(n: System.Nullable<int>) = ()
256
+
static member A(r: Result<'T, 'TError>) = ()
257
+
258
+
let test() =
259
+
M.A(3)
260
+
"""
261
+
FSharpDiagnosticSeverity.Warning
262
+
3389
263
+
(9,9,9,10)
264
+
"""This expression uses a built-in implicit conversion to convert type 'int' to type 'System.Nullable<int>'. See https://aka.ms/fsharp-implicit-convs."""
265
+
246
266
[<Test>]
247
267
let``Overloading on System.Nullable<int>,System.Nullable<'T> and int all work without error``()=
248
268
CompilerAssert.RunScript
@@ -403,7 +423,7 @@ let test() =
403
423
]))
404
424
405
425
[<Test>]
406
-
let``Test retrieving an argument set in nested method call property setter works``()=
426
+
let``Test retrieving an argument provided in a nested method call property setter works``()=
0 commit comments