Commit Graph
67 Commits
Author SHA1 Message Date
Marek Safar 5c55eea17e Basic optional parameters support in binder. Fixes #13817 2013-08-08 13:31:08 +02:00
Marek Safar 7950d8b97d Update binder primitive conversion to match .net 2013-03-05 15:03:38 +01:00
Marek Safar 57735a0aba Use faster array cloning 2013-03-03 22:22:21 +01:00
Marek Safar feb5080d23 Optimize parameters handling to do much less allocation 2013-02-25 14:11:04 +01:00
Marek Safar d4fb0b0e4e Clean up params binder 2013-02-25 14:11:03 +01:00
Marek Safar 02e0ddfe44 Expand params arguments only when not binding directly parameter types. Fixes #10551 2013-02-25 14:11:03 +01:00
Marek Safar 6c06b7d204 Optmize some empty array allocations 2013-02-21 14:38:30 +01:00
Rodrigo Kumpera 4bfb844ab5 Remove some COM types under Full AOT. 2012-11-06 18:18:14 -05:00
Marek Safar 5bcc1e62e8 Implement optional parameters support in binder. Fixes #7912 2012-10-22 15:36:51 +01:00
Marek Safar 7883a2dafd Clean up some static initializers 2012-10-03 12:19:55 +01:00
Eberhard Beilharz 0ee43a1a37 Some improvements suggested by discussion in pull request
Change-Id: I9d1c2dc31b7f744a7d948fd5fb27d15b77c0ee11
2012-05-29 16:41:42 +02:00
Eberhard Beilharz ba2ba889f6 Xamarin-5278: Fix Binder.SelectMethod when passed argument is COM object
This patch fixes the problem that reflection doesn't find the
constructor of a class if one of the arguments is a COM object
implemented in unmanaged code. In that case the proxy can't
be converted to a managed object and we didn't check if the
COM object implements the desired interface.

Change-Id: Ie086bbb898ae2de8bd38b9f81422086e017a859e
2012-05-25 11:59:38 +02:00
Zoltan Varga 1c866f2830 Fix named parameter support in the Binder. Fixes #1321 2011-10-08 06:29:22 +02:00
Marek Habersack 805da076e0 [reflection] Default binder's AdjustArguments method treats ParamArray parameters which are already arrays properly
Such parameters are not adjusted as it would lead to an InvalidCastException whenever an attempt to set an array
index's value would be made.
2011-02-03 02:22:31 +01:00
Rodrigo Kumpera a3b2659db5 2010-04-20 Rodrigo Kumpera <[email protected]>
* Binder.cs (SelectMethod): Exact matching must check
	all entries because if two of them match, we must use
	the slow path.

	* Binder.cs (GetBetterMethod): Don't give generic method
	definition special treatment.

	Fixes #325306.

svn path=/trunk/mcs/; revision=155828
2010-04-20 17:34:30 +00:00
Jb Evain de3cb0fbaf 2010-03-30 Jb Evain <[email protected]>
* Binder.cs (BindToMethod): fix the case where we bind to a method
	with only one params parameter and that no args are given.


svn path=/trunk/mcs/; revision=154452
2010-03-30 13:37:08 +00:00
Jb Evain a322aeae23 in System:
2010-03-30  Jb Evain  <[email protected]>

	* MonoType.cs: let the binder reorder arguments when invoking
	params methods.
	* Activator.cs (CreateInstance): use BindToMethod instead of
	SelectMethod to make sure that params constructors are properly called.

	Fixes #591877

in System.Reflection:
2010-03-30  Jb Evain  <[email protected]>

	* Binder.cs: when invoking a params method, pack the params
	arguments before doing the actual invocation.

	Fixes #591877

svn path=/trunk/mcs/; revision=154449
2010-03-30 13:12:34 +00:00
Miguel de Icaza ddac7401a7 System.Reflection's turn to be de-ifdefified
svn path=/trunk/mcs/; revision=145241
2009-11-03 01:22:00 +00:00
Gert Driesen 79490f1be9 * BinderTest.cs: Added SelectMethod/BindToMethod tests for methods
with byref arguments.
* Binder.cs: Only allow a type to match its byref version for
BindToMethod (and not for SelectMethod).
* TypeTest.cs: Enabled test that was failing due to regression.

svn path=/trunk/mcs/; revision=137753
2009-07-12 13:21:19 +00:00
Zoltan Varga d13b74db5e 2009-07-11 Zoltan Varga <[email protected]>
* Binder.cs: Allow conversion of IntPtr to pointer types.

svn path=/trunk/mcs/; revision=137746
2009-07-11 17:57:39 +00:00
Zoltan Varga 9763367b96 2009-07-10 Zoltan Varga <[email protected]>
* Binder.cs (check_arguments): Allow a type to match its byref version.
	Fixes #520690.

svn path=/trunk/mcs/; revision=137663
2009-07-09 23:05:27 +00:00
Zoltan Varga f92f37b5ba 2009-03-11 Zoltan Varga <[email protected]>
* Binder.cs: Allow conversions from T to T?. Fixes #484294.

svn path=/trunk/mcs/; revision=129069
2009-03-11 15:10:29 +00:00
Ivan Zlatev b5d988e481 2008-06-02 Ivan N. Zlatev <[email protected]>
* MonoType.cs, Binder.cs, MonoGenericClass.cs: For property reflection 
	we should strictly match the return type if available.
	* TypeTest.cs: Add tests to verify strict return type matching of 
	property reflection.


svn path=/trunk/mcs/; revision=104695
2008-06-02 17:29:12 +00:00
Jb Evain fc978023a2 revert 104472:104474
svn path=/trunk/mcs/; revision=104479
2008-05-29 23:17:50 +00:00
Ivan Zlatev 72bb9b3fe4 2008-05-29 Ivan N. Zlatev <[email protected]>
* Binder.cs: SelectProperty must perform strict property type checking.


svn path=/trunk/mcs/; revision=104474
2008-05-29 22:12:08 +00:00
Zoltan Varga 8f7ceaacdb 2008-04-16 Zoltan Varga <[email protected]>
* Binder.cs: Applied patch from Yves Bastide ([email protected]). Add 
	support for converting integers to enums. Fixes #380361.

svn path=/trunk/mcs/; revision=100862
2008-04-16 12:52:51 +00:00
Zoltan Varga 9bb4db6093 2008-03-14 Zoltan Varga <[email protected]>
* Binder.cs (ChangeType): Add support for Char->Double/Single conversations. Fixes
	#367655.

svn path=/trunk/mcs/; revision=98264
2008-03-14 11:58:05 +00:00
Mark Probst 1a313377dc 2007-11-05 Mark Probst <[email protected]>
* Binder.cs: Treat matches with different argument types as
	ambiguous, too.  Fixes #324998.

2007-11-05  Mark Probst  <[email protected]>

	* BinderTests.cs: Add test for bug #324998.

svn path=/trunk/mcs/; revision=88879
2007-11-05 16:03:42 +00:00
Zoltan Varga a7e976e2a7 2007-11-01 Zoltan Varga <[email protected]>
* Binder.cs: Avoid returning a method with a ParamArray attribute when a normal
	method exists. Fixes #338266.

svn path=/trunk/mcs/; revision=88661
2007-11-01 16:31:45 +00:00
Zoltan Varga 16fbfc464f 2007-10-30 Zoltan Varga <[email protected]>
* Binder.cs: Applied patch from Mario A Chavez <[email protected]>. Add
	support for binding to methods with ParamArray attribute. Fixes #336841.

svn path=/trunk/mcs/; revision=88521
2007-10-30 22:08:59 +00:00
Miguel de Icaza 503b6175e1 2007-03-05 Peter Dettman <[email protected]>
* Binder.cs: The patch changes Binder.Default.GetBetterMethod to
	prefer methods in subclasses if the arg types can't disambiguate
	them.

	Also fixes a typo in the CallingConventions comparison.

svn path=/trunk/mcs/; revision=73780
2007-03-06 04:46:30 +00:00
Miguel de Icaza 8a1af5fd38 2006-11-16 Miguel de Icaza <[email protected]>
* DirectoryInfo.cs (GetFiles): Implement option with SearchOptions
	== AllDirectories

And a lot of MonoTODOs updated as well


svn path=/trunk/mcs/; revision=67998
2006-11-16 14:14:01 +00:00
Zoltan Varga ad48d1828f 2006-09-02 Zoltan Varga <[email protected]>
* Binder.cs (ReorderParameters): Really fix this.

svn path=/trunk/mcs/; revision=64761
2006-09-02 09:51:15 +00:00
Zoltan Varga 226583c4dc 2006-09-02 Zoltan Varga <[email protected]>
* Binder.cs (ReorderParameters): Fix this method. Fixes #79120.

svn path=/trunk/mcs/; revision=64760
2006-09-02 09:31:38 +00:00
Zoltan Varga 0b0effd8ca 2006-07-09 Zoltan Varga <[email protected]>
* Binder.cs: Add back the support for BindingFlags.ExactBinding. Fixes #78592.

svn path=/trunk/mcs/; revision=62374
2006-07-09 09:12:01 +00:00
Zoltan Varga 0a14610ce6 2006-06-30 Zoltan Varga <[email protected]>
* Binder.cs: Comment out the ExactBinding stuff for the release as it breaks some 
	gtk# apps.

svn path=/trunk/mcs/; revision=62158
2006-06-30 16:12:04 +00:00
Zoltan Varga 44e824256b 2006-06-07 Zoltan Varga <[email protected]>
* Binder.cs: Add support for BindingFlags.ExactBinding. Fixes #78592.

svn path=/trunk/mcs/; revision=61507
2006-06-06 22:14:41 +00:00
Atsushi Eno 4ad3d6bf02 2006-05-08 Atsushi Enomoto <[email protected]>
* Binder.cs : (Default.SelectMethod)
	  don't throw AmbiguousMatchException when one of conflicting method
	  matches weakly. Fixed bug #42547.

	* BinderTests.cs : added test for bug #42547.


svn path=/trunk/mcs/; revision=60409
2006-05-08 15:10:13 +00:00
Atsushi Eno 990d7f119d 2006-05-08 Atsushi Enomoto <[email protected]>
* Binder.cs : (DefaultBinder.BindToMethod) reorder parameters based
	  on namedParameters. Fixed bug #41691.

	* BinderTests.cs : added test for bug #41691.


svn path=/trunk/mcs/; revision=60408
2006-05-08 14:45:08 +00:00
Zoltan Varga 6cfdbc3661 2006-03-12 Zoltan Varga <[email protected]>
* Binder.cs: Applied patch from Ben to fix #74947.

svn path=/trunk/mcs/; revision=57876
2006-03-12 18:32:10 +00:00
Gonzalo Paniagua Javier 1d741e9b4d 2005-06-15 Gonzalo Paniagua Javier <[email protected]>
* Binder.cs: null is ok for a value type. Fixes bug #75241.


svn path=/trunk/mcs/; revision=46014
2005-06-15 06:34:10 +00:00
Zoltan Varga 601f4125e5 2005-06-06 Zoltan Varga <[email protected]>
* *.cs: Add net 2.0 ComVisibleAttribute.

svn path=/trunk/mcs/; revision=45510
2005-06-06 18:03:29 +00:00
Ben Maurer 345688cd9f 2005-05-26 Ben Maurer <[email protected]>
* Binder.cs: Avoid double checked locking and lock on typeof by
	doing init of the default binder in the cctor.


svn path=/trunk/mcs/; revision=45080
2005-05-26 20:24:30 +00:00
Lluis Sanchez d21b93593c 2005-05-17 Lluis Sanchez Gual <[email protected]>
* Binder.cs: Use IsInstanceOfType instead of IsAssignableFrom
	since GetType() may not return the correct type if the object is
	a remoting proxy. This fixes bug #74933.


svn path=/trunk/mcs/; revision=44636
2005-05-17 17:51:57 +00:00
Zoltan Varga 516b4d917a 2005-03-30 Zoltan Varga <[email protected]>
* Binder.cs (check_type): Fix byref support. Fixes #73972.

svn path=/trunk/mcs/; revision=42381
2005-03-30 18:51:23 +00:00
Ben Maurer 5539d0949a In System:
2005-02-12  Ben Maurer  <[email protected]>

	* Type.cs (GetProperty): Passing new Type [0] is different than
	null. null means `I don't care how many types this has,' while new
	Type [0] means `this must have 0 types.'

In System.Reflection:
2005-02-12  Ben Maurer  <[email protected]>

	* Binder.cs (SelectProperty): Use -1 as the dummy `I don't know
	how many types' value.


svn path=/trunk/mcs/; revision=40537
2005-02-12 16:38:56 +00:00
Miguel de Icaza 47b0eb88e5 Another bug fix from Kazuki, fixes bug: 71297
svn path=/trunk/mcs/; revision=39822
2005-01-31 06:06:57 +00:00
Zoltan Varga abfc5b1acf 2004-11-05 Zoltan Varga <[email protected]>
* Binder.cs: Add support for byref types. Fixes #69140.

svn path=/trunk/mcs/; revision=35710
2004-11-05 17:56:43 +00:00
Duncan Mak 13d1764537 Add license and copyright to all source files in corlib
svn path=/trunk/mcs/; revision=29249
2004-06-11 02:09:36 +00:00
Gonzalo Paniagua Javier ceb2d47dbb 2004-06-05 Gonzalo Paniagua Javier <[email protected]>
* Binder.cs: don't crash when we have a 'null' argument Type array.
	Allow it for non-value types. Fixed for both, methods and properties.
	Closes bug #58846.

svn path=/trunk/mcs/; revision=28859
2004-06-05 06:36:12 +00:00