JET-39 Process ?. correctly in the receiver types
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
fun Int?.optint() : Unit
|
||||
val Int?.optval : Unit
|
||||
@@ -73,3 +73,5 @@ fun foo() {
|
||||
|
||||
val IList<T>.lastIndex : Int
|
||||
get() = this.size - 1
|
||||
|
||||
val Int?.opt : Int
|
||||
@@ -777,4 +777,22 @@ JetFile: Properties.jet
|
||||
PsiElement(MINUS)('-')
|
||||
PsiWhiteSpace(' ')
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
NULLABLE_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
PsiElement(SAFE_ACCESS)('?.')
|
||||
PsiElement(IDENTIFIER)('opt')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Int')
|
||||
@@ -3,7 +3,7 @@ fun <~T~T, ~E~E> `T`T.foo(x : `E`E, y : `A`A) : `T`T {
|
||||
y `+`plus 1
|
||||
y `+1`+ 1.0
|
||||
|
||||
this?.`-`minus<T>(this)
|
||||
this?.minus<T>(this)
|
||||
|
||||
this
|
||||
}
|
||||
@@ -11,6 +11,10 @@ fun <~T~T, ~E~E> `T`T.foo(x : `E`E, y : `A`A) : `T`T {
|
||||
~A~class A
|
||||
|
||||
~+1~fun `A`A.plus(a : Any) {
|
||||
|
||||
1.`foo`foo()
|
||||
true.`!`foo()
|
||||
|
||||
1
|
||||
}
|
||||
|
||||
@@ -28,4 +32,4 @@ fun test() {
|
||||
|
||||
val <~TT~T> `TT`T.foo : `TT`T
|
||||
|
||||
fun Int.foo() = this`:std::Int`
|
||||
~foo~fun Int.foo() = this`:std::Int`
|
||||
Reference in New Issue
Block a user