Issue description

I suggest that unsafe cast shouldn't impose any restrictions on 'T, it can be nullable, non-nullable or any other type, it should be fully generic. There is nothing in initial code about nullables, so it's very confusing to user to see such error.
The build currently works for me in 9.0.1 SDK, but breaking change is coming according to this ticket https://youtrack.jetbrains.com/issue/RIDER-121095/Non-existing-NRT-related-errors
Choose one or more from the following categories of impact
Operating System
Windows (Default)
What .NET runtime/SDK kind are you seeing the issue on
.NET SDK (.NET Core, .NET 5+)
.NET Runtime/SDK version
.NET SDK 9.0.101
Reproducible code snippet and actual behavior
let test<'T> () =
let t = obj()
t :?> 'T
Possible workarounds
let test<'T> () =
let t: obj | null = obj()
t :?> 'T
or
let test<'T> () =
let t = obj()
t |> unbox<'T>
Issue description
I suggest that unsafe cast shouldn't impose any restrictions on
'T, it can be nullable, non-nullable or any other type, it should be fully generic. There is nothing in initial code about nullables, so it's very confusing to user to see such error.The build currently works for me in 9.0.1 SDK, but breaking change is coming according to this ticket https://youtrack.jetbrains.com/issue/RIDER-121095/Non-existing-NRT-related-errors
Choose one or more from the following categories of impact
nullconstructs in code not using the checknulls switch.null,not null).Operating System
Windows (Default)
What .NET runtime/SDK kind are you seeing the issue on
.NET SDK (.NET Core, .NET 5+)
.NET Runtime/SDK version
.NET SDK 9.0.101
Reproducible code snippet and actual behavior
Possible workarounds
or