[Nice-commit] Nice/stdlib/nice/lang/inline Instanceof.java,1.2,1.3
Brought to you by:
bonniot
|
From: <ar...@us...> - 2003-04-01 20:25:14
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline
In directory sc8-pr-cvs1:/tmp/cvs-serv10514/F:/nice/stdlib/nice/lang/inline
Modified Files:
Instanceof.java
Log Message:
@type patterns are automatic replaced by at any patterns if the type is equal to the type of the declaration.
All @type and #type patterns where type is a primitive type after the previous replacement will yield an error because instanceof a primitve type make no sense (yet).
An exception is made for boolean, so instanceof boolean is made to work now.
Index: Instanceof.java
===================================================================
RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/Instanceof.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Instanceof.java 20 Feb 2003 15:05:16 -0000 1.2
--- Instanceof.java 1 Apr 2003 20:25:09 -0000 1.3
***************
*** 43,46 ****
--- 43,50 ----
Type type = (Type) ((QuoteExp) args[1]).getValue();
+ // instanceof on boolean can make sense
+ if (type == Type.boolean_type)
+ type = Type.boolean_ctype;
+
if (type instanceof PrimType)
throw new bossa.util.UserError
|