Closed xgouchet closed 4 years ago
If I print the raw AST for the s: String?
parameter, I get this, so the raw AST does know that the type is nullable :
functionValueParameter
parameter
simpleIdentifier
Identifier >>>s<<< (DEFAULT_TOKEN_CHANNEL)
COLON >>>:<<< (DEFAULT_TOKEN_CHANNEL)
Inside_WS >>> <<< (HIDDEN)
type
nullableType
typeReference
userType
simpleUserType
simpleIdentifier
Identifier >>>String<<< (DEFAULT_TOKEN_CHANNEL)
quest
QUEST_NO_WS >>>?<<< (DEFAULT_TOKEN_CHANNEL)
Hi @xgouchet,
sorry for the late answer, I was very busy.. I will have a look, it should be easy to fix.
Hi @xgouchet,
I added your example as an unit test here https://github.com/kotlinx/ast/commit/bc5260ab4a22ddc421175cb06effa3587f3fb280 and fixed the missing nullable check here https://github.com/kotlinx/ast/commit/c6e164e3c0eb5747db58f8458a164cec96db0c74.
Please try the latest version and let me know if you have still issues.
Looks all good to me :) Thanks a lot
I'm parsing the following Kotlin code
kotlinx.ast
and theKotlinGrammarAntlrKotlinParser
. But weirdly, I have some nullable types which are not marked as nullable.Here's what I get when printing the AST nodes
I'm using version
c35b50fa44
from JitPack :