When compiled with F# 9.0 this code produces a runtime error:
open System
let printTypeConstraintsNative<'T when 'T : unmanaged> () = printf $"Hello: {typeof<'T>.FullName} is unmanaged"
let Main() =
// null Seq
let func (x:int) : 'T when 'T : unmanaged = Unchecked.defaultof<'T>
let initFinite = Seq.init<nativeint> 3 func
printfn "%A" initFinite
printTypeConstraintsNative<nativeint>()
Main()
Program output:
c:\temp>c:\kevinransom\fsharp\artifacts\bin\fsc\Release\net472\fsc C:\Users\kevinr\source\repos\ConsoleApp82\ConsoleApp82\Program.fs
Microsoft (R) F# Compiler version 12.9.100.0 for F# 9.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
c:\temp>Program.exe
Hello: System.IntPtr is unmanaged
Unhandled Exception: System.TypeLoadException: Method 'Specialize' on type 'func@8' from assembly 'Program, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' tried to implicitly override a method with weaker type parameter constraints.
at Program.Main()
at <StartupCode$Program>.$Program.main@()
compile with F# 8.0 works fine.

When compiled with F# 9.0 this code produces a runtime error:
Program output:
compile with F# 8.0 works fine.