PsiType comparison

How would I compare whether two PsiTypes are exactly equal? Using
isAssignableFrom() works except that PsiType:null is assignable to
anything and I specifically don't want that. What does isConvertableFrom do?

Thanks,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

3 comments
Comment actions Permalink

Gordon Tyler wrote:

How would I compare whether two PsiTypes are exactly equal? Using
isAssignableFrom() works except that PsiType:null is assignable to
anything and I specifically don't want that.


You can use equals() on PsiType to check whether one is exactly equal to
another.

What does isConvertableFrom do?


"Convertable" means that value of one type can be casted to the other type.

Hope this helps,
Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Dmitry Lomov (JetBrains) wrote:
>>What does isConvertableFrom do?
> "Convertable" means that value of one type can be casted to the
other type.


Shouldn't it be "convertIble"?
See:
http://dictionary.reference.com/search?q=convertible&r=67

Alain

0
Comment actions Permalink

Dmitry Lomov (JetBrains) wrote:
>>How would I compare whether two PsiTypes are exactly equal? Using
>>isAssignableFrom() works except that PsiType:null is assignable to
>>anything and I specifically don't want that.


You can use equals() on PsiType to check whether one is exactly equal to
another.


Duh, should have thought of that 8)

Thanks,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0

Please sign in to leave a comment.