mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 17:02:10 -10:00
Support ParameterDefaultValueAttribute in gmcs. Also applied to mcs to keep code differences small. * attribute.cs (Attribute.GetParameterDefaultValue): New. * typemanager.cs (parameter_default_value_attribute_type): New. * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add CS1908 check. In mcs: Support ParameterDefaultValueAttribute in gmcs. Also applied to mcs to keep code differences small. * attribute.cs (Attribute.GetParameterDefaultValue): New. * typemanager.cs (parameter_default_value_attribute_type): New. * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add CS1908 check. In errors: * gcs1908.cs, gcs1908-2.cs, gcs1908-3.cs, gcs1908-4.cs: New tests for DefaultParameterValueAttribute. In tests: * gtest-262.cs: New test for DefaultParameterValueAttribute. svn path=/trunk/mcs/; revision=58300
9 lines
203 B
C#
9 lines
203 B
C#
// gcs1908.cs: The type of the default value should match the type of the parameter
|
|
// Line: 5
|
|
|
|
class Test {
|
|
internal void f ([System.Runtime.InteropServices.DefaultParameterValue (1)] short x)
|
|
{
|
|
}
|
|
}
|