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
The recent PR to add MedataToken getter overrides to builder classes has broken FSI code generation on dotnet 6.0: Add MetadataToken getter override to builder classes (#43330) · b72b13e (github.com)
The method:
private int GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeDefinition)
was modified here: runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs at 01b7e73 · dotnet/runtime (github.com)
This working code:
if (symMethod.GetModule() == this)
1231
return symMethod.GetToken();
1232
Became this failing code:
if (symMethod.GetModule() == this)
return symMethod.MetadataToken;
symMethod is an instance of System.Reflection.Emit.SymbolMethod: here runtime/SymbolMethod.cs at main · dotnet/runtime (github.com)
Which does not provide an override for the MetadataToken property, thus it relies on MemberInfos base implementation which throws a System.InvalidOperationException: 'Operation is not valid due to the current state of the object.'
I assume, someone should either revert the change back to return symMethod.GetToken(); … or provide an overload for MetadataToken on System.Reflection.Emit.SymbolMethod.
Repro:
On a machine with a Net6.0 dotnet sdk installed:
In a command window type:
dotnet fsi
let arr = Array2D.create 3 4 0
let _ = Array2D.get arr 0 0
;;
observe the output:
error FS0193: internal error: Operation is not valid due to the current state of the object.
You may see a bunch of warnings on fsi startup like this, this is an unrelated bug, a fix is in the pipeline:
unknown(1,1): warning FS3384: The .NET SDK for this script could not be determined. If the script is in a directory using a 'global.json' then ensure the relevant .NET SDK is installed. Unexpected error 'Could not find a part of the path 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\0.0.0.0\ref'.'.
The text was updated successfully, but these errors were encountered:
I assume @dotnet/area-system-reflection crew will take care of this before .NET 6 ships. If you would like to accelerate it, you can submit a PR with the fix.
The recent PR to add MedataToken getter overrides to builder classes has broken FSI code generation on dotnet 6.0: Add MetadataToken getter override to builder classes (#43330) · b72b13e (github.com)
The method:
was modified here: runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs at 01b7e73 · dotnet/runtime (github.com)
This working code:
Became this failing code:
symMethod
is an instance ofSystem.Reflection.Emit.SymbolMethod
: here runtime/SymbolMethod.cs at main · dotnet/runtime (github.com)Which does not provide an override for the MetadataToken property, thus it relies on MemberInfos base implementation which throws a System.InvalidOperationException: 'Operation is not valid due to the current state of the object.'
I assume, someone should either revert the change back to return symMethod.GetToken(); … or provide an overload for MetadataToken on System.Reflection.Emit.SymbolMethod.
Repro:
On a machine with a Net6.0 dotnet sdk installed:
In a command window type:
observe the output:
You may see a bunch of warnings on fsi startup like this, this is an unrelated bug, a fix is in the pipeline:
The text was updated successfully, but these errors were encountered: