fork(7) download
  1. using System;
  2. using System.Reflection;
  3.  
  4. class FailerAttr : Attribute {
  5. public FailerAttr(string s) {
  6. throw new Exception("I should definitely fail!");
  7. }
  8. }
  9.  
  10. public class Test
  11. {
  12. private class Failer {
  13. [FailerAttr("")]
  14. public int Prop { get; set; }
  15. }
  16. public static void Main()
  17. {
  18. Attribute.GetCustomAttribute(typeof(Failer).GetProperty("Prop"), typeof(FailerAttr));
  19. }
  20. }
Runtime error #stdin #stdout #stderr 0.03s 36504KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Unhandled Exception: System.Exception: I should definitely fail!
  at FailerAttr..ctor (System.String s) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttribute (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.Attribute.GetCustomAttribute (System.Reflection.MemberInfo element, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.Attribute.GetCustomAttribute (System.Reflection.MemberInfo element, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at Test.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: I should definitely fail!
  at FailerAttr..ctor (System.String s) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.MonoCustomAttrs.GetCustomAttribute (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.Attribute.GetCustomAttribute (System.Reflection.MemberInfo element, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0 
  at System.Attribute.GetCustomAttribute (System.Reflection.MemberInfo element, System.Type attributeType) [0x00000] in <filename unknown>:0 
  at Test.Main () [0x00000] in <filename unknown>:0