Bugzilla – Bug 323931
[GMCS] Type inference wrt. params
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by mhabersack@novell.com 2007-03-28 06:47:20 MST ---- The code in the test case attached to this bug fails to compile on Mono, compiles fine on MS.NET. Tested with svn head. ---- Additional Comments From mhabersack@novell.com 2007-03-28 06:48:25 MST ---- Created an attachment (id=171716) test.cs ---- Additional Comments From mhabersack@novell.com 2007-03-28 10:04:55 MST ---- MS.NET seems to infer the method's T type from the method parameters which use T. E.g. if in the attached test case List<string> would be replaced with List<MyClass>, MS.NET would instantiate the TestMethod with <MyClass>: IL_0000: nop IL_0001: newobj instance void class App/MyClass::.ctor() IL_0006: stloc.0 IL_0007: newobj instance void class [mscorlib]System.Collections.Generic.List`1<class App/MyClass>::.ctor() IL_000c: stloc.1 IL_000d: ldstr "Some format {0}" IL_0012: ldloc.1 IL_0013: ldc.i4.1 IL_0014: newarr App/MyClass IL_0019: stloc.2 IL_001a: ldloc.2 IL_001b: ldc.i4.0 IL_001c: ldloc.0 IL_001d: stelem.ref IL_001e: ldloc.2 IL_001f: call void class App::TestMethod<class App/MyClass> (string, class [mscorlib]System.Collections.Generic.List`1<!!0>, clas s App/MyClass[]) IL_0024: nop IL_0025: ret ---- Additional Comments From martin@ximian.com 2007-04-10 14:05:41 MST ---- -> me and assi ---- Additional Comments From martin@ximian.com 2007-04-10 14:05:58 MST ---- . ---- Additional Comments From martin@ximian.com 2007-04-11 06:59:46 MST ---- Fixed in SVN; added gtest-328.cs. Imported an attachment (id=171716) Unknown operating system unknown. Setting to default OS "Other".