edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/IronPython/Tests/test_methoddispatch.py;C1459771 File: test_methoddispatch.py =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/IronPython/Tests/test_methoddispatch.py;C1459771 (server) 2/19/2010 4:51 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/IronPython/Tests/test_methoddispatch.py;TypeInferenceBugs @@ -1343,21 +1343,6 @@ AreEqual(res, 'abc') -# verify calling a generic method w/o args throws a reasonable exception -def test_array_badargs(): - import System - x = System.Array.CreateInstance(System.Byte, 1024) - try: - System.Array.Resize(x, 2048) - AssertUnreachable() - except TypeError: - pass - - System.Array.Resize[System.Byte](x, 2048) - - #TODO specify clearly which exception is appropriate here - AssertError(Exception, System.Collections.Generic.List) - # verify calls to explicit interface implementations def test_explicit(): x = ExplicitTest() =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1594871 File: RubyTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1594871 (server) 2/17/2010 3:19 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;TypeInferenceBugs @@ -468,6 +468,7 @@ ClrMethodEnumeration2, ClrIndexers1, ClrGenericMethods1, + ClrGenericParametersInference1, ClrOverloadSelection1, ClrOverloadSelection2, ClrNewSlot1, =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1597865 File: ClrTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1597865 (server) 2/17/2010 3:18 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;TypeInferenceBugs @@ -15,12 +15,14 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using IronRuby.Builtins; using IronRuby.Runtime; +using Microsoft.Scripting.Hosting; using Microsoft.Scripting.Math; using Microsoft.Scripting.Runtime; using Microsoft.Scripting.Utils; @@ -546,6 +548,71 @@ ); } + public class Inference1 { + public int ByRef(ref T x) { + x = (T)(object)((int)(object)x + 1); + return 0; + } + + public int Array(T[] x) { + return 1; + } + + public int Multiple(IEnumerable source, Func selector) { + return 2; + } + + public int DeepShape(Dictionary, Dictionary> arg) { + return 3; + } + + public int Complex(ref Dictionary[], int>>, Func, B, C>>[] arg) { + return 4; + } + } + + public void ClrGenericParametersInference1() { + Context.ObjectClass.SetConstant("F", Context.GetClass(typeof(Func))); + Context.ObjectClass.SetConstant("SB", Context.GetClass(typeof(StrongBox))); + Context.ObjectClass.SetConstant("SBx", + new StrongBox[], int>>, Func, bool, double>>[]>() + ); + Context.ObjectClass.SetConstant("I", new Inference1()); + + TestOutput(@" +p I.Array(System::Array[Fixnum].new(3)) +p I.Multiple([1,2,3], F.new { |x| x.to_s }) +", @" +1 +2 +"); + + TestOutput(@" +p I.ByRef(2) +sb = SB.new(10) +p I.ByRef(sb), sb.Value +", @" +[0, 3] +0 +11 +"); + + TestOutput(@" +include System::Collections::Generic +p I.DeepShape(Dictionary[List[Fixnum], Dictionary[Fixnum, Fixnum]].new) rescue p $! +p I.DeepShape(Dictionary[Dictionary[Fixnum, System::String], Dictionary[Fixnum, Fixnum]].new) +", @" +# +3 +"); + + TestOutput(@" +p I.Complex(SBx) +", @" +4 +"); + } + #endregion #region Overloads: Inheritance, Selection ===================================================================