[svn] r6177: nemerle/trunk/ncc: hierarchy/CustomAttribute.n testsuite/negative/attributes.n

nazgul svnadmin at nemerle.org
Sat Apr 8 18:30:35 CEST 2006


Log:
Report sane error about decimal customs attribute argument

Author: nazgul
Date: Sat Apr  8 18:30:29 2006
New Revision: 6177

Modified:
   nemerle/trunk/ncc/hierarchy/CustomAttribute.n
   nemerle/trunk/ncc/testsuite/negative/attributes.n

Modified: nemerle/trunk/ncc/hierarchy/CustomAttribute.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/CustomAttribute.n	(original)
+++ nemerle/trunk/ncc/hierarchy/CustomAttribute.n	Sat Apr  8 18:30:29 2006
@@ -65,6 +65,9 @@
 
         | <[ null ]> => (null, InternalType.Type)
 
+        | PT.PExpr.Literal (Literal.Decimal) =>
+          Message.FatalError (expr.Location, "An attribute argument cannot be number of type decimal");
+        
         | PT.PExpr.Literal (lit) =>
           (lit.AsObject (), lit.GetInternalType ())
 

Modified: nemerle/trunk/ncc/testsuite/negative/attributes.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/attributes.n	(original)
+++ nemerle/trunk/ncc/testsuite/negative/attributes.n	Sat Apr  8 18:30:29 2006
@@ -1,3 +1,6 @@
+using System;
+using Nemerle.Utility;
+
 public class C
 {
  [System.NonSerialized] 
@@ -7,3 +10,15 @@
    {
    }
 }
+
+   [Record]
+    class MyAttr3Attribute : Attribute
+    {
+        [Accessor] mutable _s : string;
+        [Accessor] mutable _i : int;
+        [Accessor] mutable _c : char;
+        [Accessor] mutable _m : decimal;
+    }
+
+    [MyAttr3("Name3", 3, 'c', 33.33m)] // An attribute argument cannot be number of type decimal
+    class TestMacroTest {}



More information about the svn mailing list