Details
Description
The following program fails with an internal compiler error:
--------------------------------------------------------------------------------
enum Colors:
ORANGE
BLACK
MAGENTA
class ColorAttribute(System.Attribute):
def constructor(c as Colors):
pass
class Foo:
[Color(Colors.ORANGE)]
public bar as int
--------------------------------------------------------------------------------
The error is as follows:
attrtest.boo(12,10): BCE0055: Internal compiler error: Type must be a type provided by the runtime.
Parameter name: enumType.
Changing the "Colors" type in the attribute constructor to a plain object is a workaround for this problem.
Looks like it is a SRE gotcha. yay!
This works on Mono, and the crash is within SRE CustomAttributeBuilder.