Bug 28645

Summary: Invalid CS1908 error for dynamic parameter with DefaultParameterValue attribute
Product: [Mono] Compilers Reporter: Alexander Köplinger <alex.koeplinger>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:

Description Alexander Köplinger 2015-04-01 14:05:57 UTC
The following code generates an error when compiled with mcs:

> using System.Runtime.InteropServices;

> public class Test
> {
>     public void Foo(
>     [Optional, DefaultParameterValue(1)]
>     dynamic i)
>     {
>     }
> }


> test.cs(6,38): error CS1908: The type of the default value should match the type of the parameter
> Compilation failed: 1 error(s), 0 warnings


Note: this was extracted from the dynamics testsuite over at dotnet/corefx
Comment 1 Marek Safar 2015-04-02 11:35:55 UTC
Fixed in master