Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resumable and non-resumable CE error ranges #18450

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Fix checking bug in unpickling [PR #18430](https://github.com/dotnet/fsharp/pull/18430)
* Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401))
* 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))
* 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))
* Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457))

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2752,14 +2752,14 @@ and TranslateComputationExpressionBind
false,
consumePat.Range,
[
SynMatchClause(consumePat, None, holeFill, innerRange, DebugPointAtTarget.Yes, SynMatchClauseTrivia.Zero)
SynMatchClause(consumePat, None, holeFill, bindRange, DebugPointAtTarget.Yes, SynMatchClauseTrivia.Zero)
],
DebugPointAtBinding.NoneAtInvisible,
innerRange
)

let bindCall =
mkSynCall bindName bindRange (bindArgs @ [ consumeExpr ]) ceenv.builderValName
mkSynCall bindName holeFill.Range (bindArgs @ [ consumeExpr ]) ceenv.builderValName

translatedCtxt (bindCall |> addBindDebugPoint))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@

.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public FSharpSignatureCompressedData.assembly
{


}
.mresource public FSharpOptimizationCompressedData.assembly
{


}
.module assembly.dll

Expand All @@ -50,12 +40,11 @@
.class auto ansi serializable sealed nested assembly beforefieldinit 'f3@10-1'
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>
{
.field public int32 res
.field public int32 'value'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edgarfgp : Do you have an idea why this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. it seems that the range changed is somehow part of the generated code?

.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.method assembly specialname rtspecialname
instance void .ctor(int32 res) cil managed
.method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -65,18 +54,17 @@
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()
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::res
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::'value'
IL_000d: ret
}

.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
.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
{

.maxstack 8
IL_0000: ldarg.1
IL_0001: ldarg.0
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::res
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::'value'
IL_0007: tail.
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>,
!0)
Expand All @@ -92,8 +80,7 @@
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.method assembly specialname rtspecialname
instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
.method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -107,17 +94,15 @@
IL_000d: ret
}

.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
.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
{

.maxstack 7
.locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<int32> V_0,
class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<int32> V_1,
int32 V_2,
class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3,
int32 V_4,
int32 V_5)
int32 V_4)
IL_0000: ldc.i4.0
IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<!!0> [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref<int32>(!!0)
IL_0006: stloc.0
Expand Down Expand Up @@ -150,18 +135,15 @@
IL_0041: ldloc.2
IL_0042: stloc.s V_4
IL_0044: ldloc.s V_4
IL_0046: stloc.s V_5
IL_0048: ldloc.s V_5
IL_004a: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
IL_004f: tail.
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>)
IL_0056: ret
IL_0046: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
IL_004b: tail.
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>)
IL_0052: ret
}

}

.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32>
f3() cil managed
.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32> f3() cil managed
{

.maxstack 4
Expand All @@ -187,8 +169,7 @@
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.method private specialname rtspecialname static
void .cctor() cil managed
.method private specialname rtspecialname static void .cctor() cil managed
{

.maxstack 5
Expand All @@ -214,4 +195,3 @@




Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@

.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public FSharpSignatureCompressedData.assembly
{


}
.mresource public FSharpOptimizationCompressedData.assembly
{


}
.module assembly.dll

Expand Down Expand Up @@ -54,8 +44,7 @@
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.method assembly specialname rtspecialname
instance void .ctor(int32 'value') cil managed
.method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -69,8 +58,7 @@
IL_000d: ret
}

.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
.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
{

.maxstack 8
Expand All @@ -92,8 +80,7 @@
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.method assembly specialname rtspecialname
instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
.method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -107,8 +94,7 @@
IL_000d: ret
}

.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
.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
{

.maxstack 7
Expand Down Expand Up @@ -157,8 +143,7 @@

}

.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32>
f3() cil managed
.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<int32> f3() cil managed
{

.maxstack 4
Expand All @@ -184,8 +169,7 @@
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.method private specialname rtspecialname static
void .cctor() cil managed
.method private specialname rtspecialname static void .cctor() cil managed
{

.maxstack 5
Expand All @@ -211,4 +195,3 @@




Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@

.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public FSharpSignatureCompressedData.assembly
{


}
.mresource public FSharpOptimizationCompressedData.assembly
{


}
.module assembly.dll

Expand All @@ -50,11 +40,11 @@
.class auto ansi serializable sealed nested assembly beforefieldinit 'f3@10-1'
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>
{
.field public int32 res
.field public int32 'value'
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
.method assembly specialname rtspecialname instance void .ctor(int32 res) cil managed
.method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed
{
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
Expand All @@ -64,7 +54,7 @@
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()
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::res
IL_0008: stfld int32 assembly/assembly/'f3@10-1'::'value'
IL_000d: ret
}

Expand All @@ -74,7 +64,7 @@
.maxstack 8
IL_0000: ldarg.1
IL_0001: ldarg.0
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::res
IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::'value'
IL_0007: tail.
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>,
!0)
Expand Down Expand Up @@ -112,8 +102,7 @@
class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<int32> V_1,
int32 V_2,
class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3,
int32 V_4,
int32 V_5)
int32 V_4)
IL_0000: ldc.i4.0
IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1<!!0> [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref<int32>(!!0)
IL_0006: stloc.0
Expand Down Expand Up @@ -146,12 +135,10 @@
IL_0041: ldloc.2
IL_0042: stloc.s V_4
IL_0044: ldloc.s V_4
IL_0046: stloc.s V_5
IL_0048: ldloc.s V_5
IL_004a: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
IL_004f: tail.
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>)
IL_0056: ret
IL_0046: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32)
IL_004b: tail.
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>)
IL_0052: ret
}

}
Expand Down Expand Up @@ -246,4 +233,3 @@




Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@

.hash algorithm 0x00008004
.ver 0:0:0:0
}
.mresource public FSharpSignatureCompressedData.assembly
{


}
.mresource public FSharpOptimizationCompressedData.assembly
{


}
.module assembly.dll

Expand Down Expand Up @@ -243,4 +233,3 @@




Loading