Skip to content

Commit f63d3ff

Browse files
committed
for the time being, don't offer the fix for measure constants
1 parent 278e534 commit f63d3ff

File tree

6 files changed

+26
-1
lines changed

6 files changed

+26
-1
lines changed

ReSharper.FSharp/src/FSharp.Psi.Intentions/src/QuickFixes/UpdateLiteralConstantInSignatureFix.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type UpdateLiteralConstantInSignatureFix(error: LiteralConstantValuesDifferInSig
5454
|> Option.isSome
5555
| :? IBinaryAppExpr as binExpr ->
5656
isImplExprValidInSig binExpr.LeftArgument && isImplExprValidInSig binExpr.RightArgument
57-
| :? ILiteralExpr -> true
57+
| :? ILiteralExpr as litExpr -> isNull litExpr.UnitOfMeasure
5858
| _ -> false
5959

6060
override x.Text =
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module A
2+
3+
[<Measure>] type m
4+
5+
[<Literal>]
6+
let a{caret} = 42<m>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module A
2+
3+
[<Measure>] type m
4+
5+
[<Literal>]
6+
let a{caret} = 42<m>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module A
2+
3+
[<Measure>] type m
4+
5+
[<Literal>]
6+
val a : int<m> = 23<m>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module A
2+
3+
[<Measure>] type m
4+
5+
[<Literal>]
6+
val a : int<m> = 23<m>

ReSharper.FSharp/test/src/FSharp.Intentions.Tests/src/QuickFixes/UpdateLiteralConstantInSignatureFixTest.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ type UpdateLiteralConstantInSignatureFixTest() =
2929
[<FSharpLanguageLevel(FSharpLanguageLevel.Preview)>]
3030
[<Test; NotAvailable>] member x.``No update with unknown module symbol - 02`` () = x.DoNamedTestWithSignature()
3131
[<Test; NotAvailable>] member x.``No update with unknown other literal - 01`` () = x.DoNamedTestWithSignature()
32+
[<Test; NotAvailable>] member x.``No update for measure constant - 01`` () = x.DoNamedTestWithSignature()

0 commit comments

Comments
 (0)