Fix tests: "Placing function type parameters after the function name" error
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
inline fun with<T>(receiver : T, body : T.() -> Unit) = receiver.body()
|
||||
inline fun <T> with(receiver : T, body : T.() -> Unit) = receiver.body()
|
||||
|
||||
fun example() {
|
||||
|
||||
|
||||
+2
-1
@@ -9,12 +9,13 @@ JetFile: With.kt
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('with')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('with')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ open class ICloseable {
|
||||
|
||||
abstract class JavaCloseableWrapper(closeable : java.io.Closeable) : ICloseable(closeable)
|
||||
|
||||
fun streamCopy<T>(from : IIterable<T>, to : IAdder<T>) {
|
||||
fun <T> streamCopy(from : IIterable<T>, to : IAdder<T>) {
|
||||
for (item in from) t.add(item)
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -117,12 +117,13 @@ JetFile: IOSamples.kt
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('streamCopy')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('streamCopy')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
@@ -599,4 +600,4 @@ JetFile: IOSamples.kt
|
||||
PsiWhiteSpace(' ')
|
||||
PsiComment(EOL_COMMENT)('// throws IOException, you must catch or rethrow explicitly')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiElement(RBRACE)('}')
|
||||
+1
-1
@@ -10,7 +10,7 @@ enum class ComparisonResult {
|
||||
|
||||
typealias MatchableComparison<in T> = (T, T) -> ComparisonResult
|
||||
|
||||
fun asMatchableComparison<T>(cmp : Comparison<T>) : MatchableComparison<T> = {a, b ->
|
||||
fun <T> asMatchableComparison(cmp : Comparison<T>) : MatchableComparison<T> = {a, b ->
|
||||
val res = cmp(a, b)
|
||||
if (res == 0) return ComparisonResult.EQ
|
||||
if (res < 0) return ComparisonResult.LS
|
||||
|
||||
+2
-1
@@ -273,12 +273,13 @@ JetFile: Comparison.kt
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('asMatchableComparison')
|
||||
TYPE_PARAMETER_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('asMatchableComparison')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
|
||||
Reference in New Issue
Block a user