[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] pnet ChangeLog codegen/cg_genattr.c
From: |
Klaus Treichel |
Subject: |
[dotgnu-pnet-commits] pnet ChangeLog codegen/cg_genattr.c |
Date: |
Tue, 21 Apr 2009 19:35:49 +0000 |
CVSROOT: /cvsroot/dotgnu-pnet
Module name: pnet
Changes by: Klaus Treichel <ktreichel> 09/04/21 19:35:49
Modified files:
. : ChangeLog
codegen : cg_genattr.c
Log message:
Use the type of the ctor argument instead of raising an error if the
constant
value cannot be casted to the field, property or parameter type.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3620&r2=1.3621
http://cvs.savannah.gnu.org/viewcvs/pnet/codegen/cg_genattr.c?cvsroot=dotgnu-pnet&r1=1.2&r2=1.3
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3620
retrieving revision 1.3621
diff -u -b -r1.3620 -r1.3621
--- ChangeLog 20 Apr 2009 17:38:26 -0000 1.3620
+++ ChangeLog 21 Apr 2009 19:35:49 -0000 1.3621
@@ -1,3 +1,9 @@
+2009-04-21 Klaus Treichel <address@hidden>
+
+ * codegen/cg_genattr.c (DefaultValueAttribute): Use the ctor argument
+ type if the value cannot be casted to the type of the field, property
+ or parameter.
+
2009-04-20 Klaus Treichel <address@hidden>
* include/Makefile.am: Add il_varargs.h to the sources.
Index: codegen/cg_genattr.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_genattr.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- codegen/cg_genattr.c 19 Apr 2009 16:12:53 -0000 1.2
+++ codegen/cg_genattr.c 21 Apr 2009 19:35:49 -0000 1.3
@@ -1591,9 +1591,11 @@
!ILCanCastKind(info, attributeInfo->ctorArgs[0].type,
type, IL_CONVERT_STANDARD ,0))
{
- CGErrorForNode(info, attributeInfo->ctorArgs[0].node,
- _("could not coerce constant
argument %d"), 1);
- return 0;
+ /*
+ * could not cast to the desired type so simply use the type of
the
+ * arg and hope that the application can handle this.
+ */
+ type = attributeInfo->ctorArgs[0].type;
}
type = ILTypeGetEnumType(type);
if(ILType_IsPrimitive(type))