Page 1 of 1

Invalid expression term "char"

PostPosted: Thu Dec 15, 2011 11:06 pm
by torial
I realize this may be simple and I'm overlooking something. But when I use the following code:

Code: Select all
if char.isLetterOrDigit(key) or key == c'_'
        return CompletionDataProviderKeyResult.NormalKey


I get error:
Invalid expression term "char"


Any pointers?

Re: Invalid expression term "char"

PostPosted: Fri Dec 16, 2011 1:12 pm
by Charles
Cobra tries to be more OOP-ish in the Smalltalk vein rather than in the Java "static methods everywhere" vein. Try:

... key.isLetterOrDigit ...

See PrimitiveTypeMembers

This looks like an opportunity for one of those nice error messages that tells you straight away what's expected.