[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bug #42722] Explicit type declaration, later instance? check
From: |
Per Bothner |
Subject: |
[Bug-kawa] [bug #42722] Explicit type declaration, later instance? check issues |
Date: |
Thu, 10 Jul 2014 17:39:00 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 |
Update of bug #42722 (project kawa):
Status: None => Confirmed
Assigned to: None => bothner
_______________________________________________________
Follow-up Comment #1:
This is a gray area: The type 'String' is a special type in that every value
is compatible with it: a non-null value x is converted to the String type by
calling x.toString().
Instead, you might want to use:
(instance? v1 string) ;; lower-case string type
or:
(instance? v1 java.lang.CharSequence)
or:
(instance? v1 java.lang.String)
The type string is equivalent to java.lang.CharSequence.
Back to the String type: even if every value is convertible to String, it is
probably not correct to say (instance? v1 String). As you've noticed there
some inconsistencies in this result, if v1 is a more complex expression.
There does seem to be a bug.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42722>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/