Working on type inference for function literals

This commit is contained in:
Andrey Breslav
2011-08-26 17:51:15 +04:00
parent 4710835bd4
commit 86e8142e3c
36 changed files with 1151 additions and 1030 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ fun test(l : java.util.List<Int>) {
Collections.<error>emptyList</error>
Collections.emptyList<Int>
Collections.emptyList<Int>()
Collections.emptyList<error>()</error>
Collections.emptyList()
Collections.singleton<Int>(1) : Set<Int>?
Collections.singleton<Int><error>(1.0)</error>
@@ -43,7 +43,7 @@ fun test(l : java.util.List<Int>) {
c : java.lang.Comparable<Int>?
// Collections.sort<Integer>(ArrayList<Integer>())
xxx.Class<error>()</error>
xxx.<error>Class</error>()
}
@@ -0,0 +1,12 @@
// One of the two passes is making a scope and turning vals into functions
// See KT-76
namespace x
val b : Foo
val a1 = b.compareTo(2)
class Foo() {
fun compareTo(other : Byte) : Int
fun compareTo(other : Char) : Int
}
+1 -1
View File
@@ -298,7 +298,7 @@ JetFile: FunctionLiterals_ERR.jet
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PsiErrorElement:To specify a receiver type, use the full notation: {ReceiverType.(parameters) [: ReturnType] => ...}
PsiErrorElement:To specify a receiverType type, use the full notation: {ReceiverType.(parameters) [: ReturnType] => ...}
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
+1 -1
View File
@@ -3,7 +3,7 @@ JetFile: Properties_ERR.jet
PROPERTY
PsiElement(var)('var')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting property name or receiver type
PsiErrorElement:Expecting property name or receiverType type
PsiElement(MINUS)('-')
PsiWhiteSpace(' ')
PsiErrorElement:Property getter or setter expected
+2 -2
View File
@@ -23,7 +23,7 @@ JetFile: With.jet
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('receiver')
PsiElement(IDENTIFIER)('receiverType')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -63,7 +63,7 @@ JetFile: With.jet
PsiWhiteSpace(' ')
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('receiver')
PsiElement(IDENTIFIER)('receiverType')
PsiElement(DOT)('.')
CALL_EXPRESSION
REFERENCE_EXPRESSION