@@ -34,13 +34,14 @@ let x = deserialize "" |> f""", 3, 9, 3, 28
3434 [<Theory>]
3535 [<MemberData( nameof( warningCases)) >]
3636 let ``Warning is emitted when type Obj is inferred`` ( code : string , line1 : int , col1 : int , line2 : int , col2 : int ) =
37+ let code = $" module M\n {code}"
3738 FSharp code
3839 |> withErrorRanges
3940 |> withWarnOn 3559
4041 |> withLangVersion80
41- |> typecheck
42+ |> compile
4243 |> shouldFail
43- |> withSingleDiagnostic ( Information 3559 , Line line1, Col col1, Line line2, Col col2, message)
44+ |> withSingleDiagnostic ( Warning 3559 , Line ( line1 + 1 ) , Col col1, Line ( line2 + 1 ) , Col col2, message)
4445
4546 let quotableNoWarningCases =
4647 [
@@ -110,13 +111,13 @@ let f () = x = x |> ignore""" // measure is inferred as 1, but that's not covere
110111 [<Theory>]
111112 [<MemberData( nameof( quotableWarningCases)) >]
112113 let ``Warn also inside quotations of acceptable code`` ( expr : string , line1 : int , col1 : int , line2 : int , col2 : int ) =
113- sprintf " <@ %s @> |> ignore" expr
114+ sprintf " module M \n <@ %s @> |> ignore" expr
114115 |> FSharp
115116 |> withWarnOn 3559
116117 |> withLangVersion80
117- |> typecheck
118+ |> compile
118119 |> shouldFail
119- |> withSingleDiagnostic ( Information 3559 , Line line1, Col ( col1 + 3 ), Line line2, Col ( col2 + 3 ), message)
120+ |> withSingleDiagnostic ( Warning 3559 , Line ( line1 + 1 ) , Col ( col1 + 3 ), Line ( line2 + 1 ) , Col ( col2 + 3 ), message)
120121
121122 [<Theory>]
122123 [<MemberData( nameof( quotableNoWarningCases)) >]
0 commit comments