Skip to content

Commit 54321fe

Browse files
authored
Fix resumable and non-resumable CE error ranges (#18450)
1 parent b567966 commit 54321fe

File tree

23 files changed

+1001
-919
lines changed

23 files changed

+1001
-919
lines changed

docs/release-notes/.FSharp.Compiler.Service/9.0.300.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* Fix checking bug in unpickling [PR #18430](https://github.com/dotnet/fsharp/pull/18430)
2424
* Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401))
2525
* Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436))
26+
* Fix confusing type inference error in task expression ([Issue #13789](https://github.com/dotnet/fsharp/issues/13789), [PR #18450](https://github.com/dotnet/fsharp/pull/18450))
2627
* Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457))
2728
* Make `[<CallerMemberName; Struct>]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/))
2829

src/Compiler/Checking/Expressions/CheckComputationExpressions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2759,7 +2759,7 @@ and TranslateComputationExpressionBind
27592759
)
27602760

27612761
let bindCall =
2762-
mkSynCall bindName bindRange (bindArgs @ [ consumeExpr ]) ceenv.builderValName
2762+
mkSynCall bindName holeFill.Range (bindArgs @ [ consumeExpr ]) ceenv.builderValName
27632763

27642764
translatedCtxt (bindCall |> addBindDebugPoint))
27652765

tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.debug.bsl

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616

1717
.hash algorithm 0x00008004
1818
.ver 0:0:0:0
19-
}
20-
.mresource public FSharpSignatureCompressedData.assembly
21-
{
22-
23-
24-
}
25-
.mresource public FSharpOptimizationCompressedData.assembly
26-
{
27-
28-
2919
}
3020
.module assembly.dll
3121

@@ -50,12 +40,11 @@
5040
.class auto ansi serializable sealed nested assembly beforefieldinit 'f3@10-1'
5141
extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>
5242
{
53-
.field public int32 res
43+
.field public int32 'value'
5444
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
5545
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
5646
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
57-
.method assembly specialname rtspecialname
58-
instance void .ctor(int32 res) cil managed
47+
.method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed
5948
{
6049
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
6150
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
@@ -65,18 +54,17 @@
6554
IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor()
6655
IL_0006: ldarg.0
6756
IL_0007: ldarg.1
68-
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::res
57+
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::'value'
6958
IL_000d: ret
7059
}
7160

72-
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn
73-
Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32> ctxt) cil managed
61+
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32> ctxt) cil managed
7462
{
7563

7664
.maxstack 8
7765
IL_0000: ldarg.1
7866
IL_0001: ldarg.0
79-
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::res
67+
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::'value'
8068
IL_0007: tail.
8169
IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32>::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<!0>,
8270
!0)
@@ -92,8 +80,7 @@
9280
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
9381
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
9482
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
95-
.method assembly specialname rtspecialname
96-
instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
83+
.method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
9784
{
9885
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
9986
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
@@ -107,17 +94,15 @@
10794
IL_000d: ret
10895
}
10996

110-
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32>
111-
Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed
97+
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32> Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed
11298
{
11399

114100
.maxstack 7
115101
.locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<int32> V_0,
116102
class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<int32> V_1,
117103
int32 V_2,
118104
class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3,
119-
int32 V_4,
120-
int32 V_5)
105+
int32 V_4)
121106
IL_0000: ldc.i4.0
122107
IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<!!0> [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref<int32>(!!0)
123108
IL_0006: stloc.0
@@ -150,18 +135,15 @@
150135
IL_0041: ldloc.2
151136
IL_0042: stloc.s V_4
152137
IL_0044: ldloc.s V_4
153-
IL_0046: stloc.s V_5
154-
IL_0048: ldloc.s V_5
155-
IL_004a: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
156-
IL_004f: tail.
157-
IL_0051: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<!!0> [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync<int32>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<!!0>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>)
158-
IL_0056: ret
138+
IL_0046: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
139+
IL_004b: tail.
140+
IL_004d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<!!0> [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync<int32>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<!!0>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>)
141+
IL_0052: ret
159142
}
160143

161144
}
162145

163-
.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32>
164-
f3() cil managed
146+
.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32> f3() cil managed
165147
{
166148

167149
.maxstack 4
@@ -187,8 +169,7 @@
187169
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
188170
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
189171
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
190-
.method private specialname rtspecialname static
191-
void .cctor() cil managed
172+
.method private specialname rtspecialname static void .cctor() cil managed
192173
{
193174

194175
.maxstack 5
@@ -214,4 +195,3 @@
214195

215196

216197

217-

tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.release.bsl

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616

1717
.hash algorithm 0x00008004
1818
.ver 0:0:0:0
19-
}
20-
.mresource public FSharpSignatureCompressedData.assembly
21-
{
22-
23-
24-
}
25-
.mresource public FSharpOptimizationCompressedData.assembly
26-
{
27-
28-
2919
}
3020
.module assembly.dll
3121

@@ -54,8 +44,7 @@
5444
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
5545
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
5646
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
57-
.method assembly specialname rtspecialname
58-
instance void .ctor(int32 'value') cil managed
47+
.method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed
5948
{
6049
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
6150
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
@@ -69,8 +58,7 @@
6958
IL_000d: ret
7059
}
7160

72-
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn
73-
Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32> ctxt) cil managed
61+
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32> ctxt) cil managed
7462
{
7563

7664
.maxstack 8
@@ -92,8 +80,7 @@
9280
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
9381
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
9482
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
95-
.method assembly specialname rtspecialname
96-
instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
83+
.method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
9784
{
9885
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
9986
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
@@ -107,8 +94,7 @@
10794
IL_000d: ret
10895
}
10996

110-
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32>
111-
Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed
97+
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32> Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed
11298
{
11399

114100
.maxstack 7
@@ -157,8 +143,7 @@
157143

158144
}
159145

160-
.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32>
161-
f3() cil managed
146+
.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32> f3() cil managed
162147
{
163148

164149
.maxstack 4
@@ -184,8 +169,7 @@
184169
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
185170
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
186171
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
187-
.method private specialname rtspecialname static
188-
void .cctor() cil managed
172+
.method private specialname rtspecialname static void .cctor() cil managed
189173
{
190174

191175
.maxstack 5
@@ -211,4 +195,3 @@
211195

212196

213197

214-

tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.debug.bsl

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616

1717
.hash algorithm 0x00008004
1818
.ver 0:0:0:0
19-
}
20-
.mresource public FSharpSignatureCompressedData.assembly
21-
{
22-
23-
24-
}
25-
.mresource public FSharpOptimizationCompressedData.assembly
26-
{
27-
28-
2919
}
3020
.module assembly.dll
3121

@@ -50,11 +40,11 @@
5040
.class auto ansi serializable sealed nested assembly beforefieldinit 'f3@10-1'
5141
extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>
5242
{
53-
.field public int32 res
43+
.field public int32 'value'
5444
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
5545
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
5646
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
57-
.method assembly specialname rtspecialname instance void .ctor(int32 res) cil managed
47+
.method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed
5848
{
5949
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
6050
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
@@ -64,7 +54,7 @@
6454
IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor()
6555
IL_0006: ldarg.0
6656
IL_0007: ldarg.1
67-
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::res
57+
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::'value'
6858
IL_000d: ret
6959
}
7060

@@ -74,7 +64,7 @@
7464
.maxstack 8
7565
IL_0000: ldarg.1
7666
IL_0001: ldarg.0
77-
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::res
67+
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::'value'
7868
IL_0007: tail.
7969
IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<int32>::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<!0>,
8070
!0)
@@ -112,8 +102,7 @@
112102
class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<int32> V_1,
113103
int32 V_2,
114104
class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3,
115-
int32 V_4,
116-
int32 V_5)
105+
int32 V_4)
117106
IL_0000: ldc.i4.0
118107
IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<!!0> [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref<int32>(!!0)
119108
IL_0006: stloc.0
@@ -146,12 +135,10 @@
146135
IL_0041: ldloc.2
147136
IL_0042: stloc.s V_4
148137
IL_0044: ldloc.s V_4
149-
IL_0046: stloc.s V_5
150-
IL_0048: ldloc.s V_5
151-
IL_004a: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
152-
IL_004f: tail.
153-
IL_0051: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<!!0> [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync<int32>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<!!0>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>)
154-
IL_0056: ret
138+
IL_0046: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
139+
IL_004b: tail.
140+
IL_004d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<!!0> [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync<int32>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1<!!0>,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>)
141+
IL_0052: ret
155142
}
156143

157144
}
@@ -246,4 +233,3 @@
246233

247234

248235

249-

tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.release.bsl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616

1717
.hash algorithm 0x00008004
1818
.ver 0:0:0:0
19-
}
20-
.mresource public FSharpSignatureCompressedData.assembly
21-
{
22-
23-
24-
}
25-
.mresource public FSharpOptimizationCompressedData.assembly
26-
{
27-
28-
2919
}
3020
.module assembly.dll
3121

@@ -243,4 +233,3 @@
243233

244234

245235

246-

0 commit comments

Comments
 (0)