JET-51 Check generic bounds in method calls

+
A bug in parseCallExpression() heuristics fixed
This commit is contained in:
Andrey Breslav
2011-05-24 21:22:55 +04:00
parent 139af5b36a
commit 2a2a697953
7 changed files with 105 additions and 32 deletions
+15
View File
@@ -23,3 +23,18 @@ namespace boundsWithSubstitutors {
val x : {(B<<error>Char</error>>) : B<<error>Any</error>>}
}
fun test() {
foo<<error>Int?</error>>()
foo<Int>()
bar<Int?>()
bar<Int>()
bar<<error>Double?</error>>()
bar<<error>Double</error>>()
1.buzz<<error>Double</error>>()
}
fun foo<T : Any>() {}
fun bar<T : Int?>() {}
fun <T : Int> Int.buzz() : Unit {}
@@ -1,4 +1,6 @@
fun foo() {
foo<Int?>()
fooo<Double?addddd>()
dd<(Int, Int, Int)>(if (true) (1, 1, 1) else (2, 2, 2))
foo(bar<a, b, c>(d))
foo(bar<a, b+1, c>(d))
@@ -11,6 +11,42 @@ JetFile: TypeExpressionAmbiguities_ERR.jet
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
NULLABLE_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiElement(QUEST)('?')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('fooo')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
NULLABLE_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Double')
PsiElement(QUEST)('?')
PsiErrorElement:Expecting a '>'
PsiElement(IDENTIFIER)('addddd')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('dd')