Roslyn: Attribute ctor with 'in' parameter + implicit 'in' argument

Created on 27 Oct 2017  路  4Comments  路  Source: dotnet/roslyn

Version Used:

Master branch from 27.10.2017

Steps to Reproduce:

c# [A(1)] class A : System.Attribute { A(in int x) { } }

Actual Behavior:

It compiles :) Cecil crashes when trying to read metadata produced.

Expected Behavior:

Compiler error over 1 argument range.

p.s. Error message in the case of passing attribute arguments to ref/out parameters suggest to use ref/out modifiers that are not parseable in the context of attribute arguments.

cc @VSadov

Area-Compilers Bug

All 4 comments

Yes, should be an error. Good catch!

@VSadov I feel this is cornercase enough that it wouldn't meet the bar for 15.5.
15.6 ok?

@jcouv - 15.6
It would not meet the bar for 15.5 at this point. There are obvious workarounds - "do not do this".
It is still a bug. Spec should disallow this scenario.

Was this page helpful?
0 / 5 - 0 ratings