Skip to content

Commit

Permalink
Support definitely non-nullable type
Browse files Browse the repository at this point in the history
  • Loading branch information
taku0 committed Jan 15, 2023
1 parent 658af11 commit 3e548c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kotlin-mode-lexer.el
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ expression as a token with one of the following types:
'(implicit-\; string-chunk-before-template-expression))
(member
(kotlin-mode--token-text previous-token)
'("(" "{" "[" "*" "%" "/" "+" "-" "&&" "||" ":"
'("(" "{" "[" "*" "%" "/" "+" "-" "&&" "||" ":" "&"
"=" "+=" "-=" "*=" "/=" "%="
"->" "." ".." "::" "?:" "?." "<=" ">=" "!=" "!==" "==" "==="
"as" "as?" "is" "!is" "in" "!in" "," ";" "{" "[" "("
Expand Down Expand Up @@ -790,7 +790,7 @@ expression as a token with one of the following types:
'(implicit-\; string-chunk-after-template-expression))
(member
(kotlin-mode--token-text next-token)
'("*" "%" "/" "&&" "||" ":" "=" "+=" "-=" "*=" "/=" "%="
'("*" "%" "/" "&" "&&" "||" ":" "=" "+=" "-=" "*=" "/=" "%="
"->" "." ".." "::" "?:" "?." "?" "<" ">" "<=" ">="
"!=" "!==" "==" "==="
"," ";" ")" "]" "}"
Expand Down Expand Up @@ -1828,7 +1828,7 @@ This function does not return `implicit-;'."
"=" "+=" "-=" "*=" "/=" "%="
"->"
".." "." "?:" "?." "?" "<" ">" "<=" ">=" "==" "==="
"*" "%" "/" "+" "-")))
"*" "%" "/" "+" "-" "&")))
(let ((text (match-string-no-properties 0))
(start (match-beginning 0))
(end (match-end 0)))
Expand Down Expand Up @@ -2233,7 +2233,7 @@ This function does not return `implicit-;'"
((member (buffer-substring-no-properties
(max (point-min) (- (point) 1))
(point))
'("*" "%" "/" "+" "-" "!" "=" "." "?" "<" ">"))
'("*" "%" "/" "+" "-" "!" "=" "." "?" "<" ">" "&"))
(backward-char)
(make-instance 'kotlin-mode--token
:type 'operator
Expand Down
9 changes: 9 additions & 0 deletions test/pathological.kt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,15 @@ public
->
C

// definitelyNonNullableType
fun foo(
x:
A
&
Any
) {
}

// value class

value
Expand Down

0 comments on commit 3e548c2

Please sign in to comment.