んじゃ F# だとどうよみたいな話
F# 1.9.3.7 にて実験.
open System open System.Collections.Generic open Microsoft.FSharp type Util = struct [<OverloadID("1")>] static member Hey (dict:IDictionary<'a, 'b> when 'b:>IEnumerable<'a>) = "HauHau!" [<OverloadID("2")>] static member Hey (dict:IDictionary<'a, 'b> when 'a:>IEnumerable<'b>) = "Foo!" end
Creating main module... Generating IL code... Writing assembly... Duplicate in method table is: Type index: 5 Method name: Hey Method arity (num generic params): 2 Method return type: class ['mscorlib']'System.String' Method arg: class ['mscorlib']'System.Collections.Generic.IDictionary`2' <!00, !11> Error in pass2 for type Util, error: Failure("duplicate entry 'Hey' in method table") Error in pass2 for type File1, error: Failure("duplicate entry 'Hey' in method table")
駄目でした.
正直これはバグなのか仕様なのかよく分からないところもありますが.