var cand_param = candidate_pd.FixedParameters [j];
var best_param = best_pd.FixedParameters [j];
+ if (cand_param.HasDefaultValue != best_param.HasDefaultValue)
+ return cand_param.HasDefaultValue;
+
if (candidate_pd.Count == best_pd.Count) {
//
// LAMESPEC:
// void Foo (int i = 0) is better than void Foo (params int[]) for Foo ()
// void Foo (string[] s, string value = null) is better than Foo (string s, params string[]) for Foo (null) or Foo ()
//
- if (cand_param.HasDefaultValue != best_param.HasDefaultValue)
- return cand_param.HasDefaultValue;
if (cand_param.HasDefaultValue) {
++j;
// void Foo (string s, int i = 0) <-> Foo (string s, byte i = 0)
// void Foo (string s, params int[]) <-> Foo (string s, params byte[])
//
- if (cand_param.HasDefaultValue && best_param.HasDefaultValue)
- return false;
+ return false;
}
break;
static int Test_6 (params object[] o)
{
- return 0;
+ return 1;
}
static int Test_6 (int i = 1, params object[] a)
{
- return 1;
+ return 0;
}
static int Test_7 (bool b, params object[] o)
{
- return 0;
+ return 1;
}
static int Test_7 (bool b, int i = 1, params object[] a)
+ {
+ return 0;
+ }
+
+ static int Test_8 (Type t, bool b = false, int x = 0)
+ {
+ return 0;
+ }
+
+ static int Test_8 (Type t, params int[] x)
{
return 1;
}
if (Test_7 (false) != 0)
return 7;
+ if (Test_8 (typeof (bool)) != 0)
+ return 8;
+
Console.WriteLine ("ok");
return 0;
}
<size>10</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>161</size>
+ <size>192</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</method>
+ <method name="Int32 Test_8(System.Type, Boolean, Int32)" attrs="145">
+ <size>10</size>
+ </method>
+ <method name="Int32 Test_8(System.Type, Int32[])" attrs="145">
+ <size>10</size>
+ </method>
</type>
</test>
<test name="gtest-optional-10.cs">