"type" is not a keyword anymore ("typealias" reserved instead)

This commit is contained in:
Andrey Breslav
2014-10-11 02:17:50 +04:00
parent b20439027c
commit cc68ed894b
41 changed files with 695 additions and 717 deletions
@@ -1,24 +1,24 @@
type f1 = (T) -> X
typealias f1 = (T) -> X
// type f1 = {(T) => X}
type f2 = (T, E) -> X
typealias f2 = (T, E) -> X
// type f2 = {(T, E) => X}
type f_tuple = (Pair<T, E>) -> X
typealias f_tuple = (Pair<T, E>) -> X
//type f_tuple = {((T, E)) => X}
type hof = (X) -> (T) -> Y
typealias hof = (X) -> (T) -> Y
//type hof = { (X) => {(T) => Y} }
type hof2 = ( (X) -> Y) -> (Y) -> Z
typealias hof2 = ( (X) -> Y) -> (Y) -> Z
//type hof2 = { {(X) => Y} => {(Y) => Z} }
type Comparison<in T> = (a : T, b : T) -> Int
typealias Comparison<in T> = (a : T, b : T) -> Int
//type Comparison<in T> = {(a : T, b : T) => Int}
type Equality<in T> = (a : T, b : T) -> Boolean
typealias Equality<in T> = (a : T, b : T) -> Boolean
//type Equality<in T> = {(a : T, b : T) => Boolean}
type HashFunction<in T> = (obj : T) -> Int
typealias HashFunction<in T> = (obj : T) -> Int
//type HashFunction<in T> = {(obj : T) => Int}
type Runnable = () -> Unit
typealias Runnable = () -> Unit
//type Runnable = {() => ()}
type Function1<in T, out R> = (input : T) -> R
typealias Function1<in T, out R> = (input : T) -> R
//type Function1<in T, out R> = {(input : T) => R}
@@ -2,7 +2,7 @@ JetFile: FunctionsAndTypes.kt
PACKAGE_DIRECTIVE
<empty list>
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('f1')
PsiWhiteSpace(' ')
@@ -29,7 +29,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('// type f1 = {(T) => X}')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('f2')
PsiWhiteSpace(' ')
@@ -63,7 +63,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('// type f2 = {(T, E) => X}')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('f_tuple')
PsiWhiteSpace(' ')
@@ -105,7 +105,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('//type f_tuple = {((T, E)) => X}')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('hof')
PsiWhiteSpace(' ')
@@ -145,7 +145,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('//type hof = { (X) => {(T) => Y} }')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('hof2')
PsiWhiteSpace(' ')
@@ -199,7 +199,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('//type hof2 = { {(X) => Y} => {(Y) => Z} }')
PsiWhiteSpace('\n\n\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Comparison')
TYPE_PARAMETER_LIST
@@ -249,7 +249,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('//type Comparison<in T> = {(a : T, b : T) => Int}')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Equality')
TYPE_PARAMETER_LIST
@@ -299,7 +299,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('//type Equality<in T> = {(a : T, b : T) => Boolean}')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('HashFunction')
TYPE_PARAMETER_LIST
@@ -338,7 +338,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('//type HashFunction<in T> = {(obj : T) => Int}')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Runnable')
PsiWhiteSpace(' ')
@@ -360,7 +360,7 @@ JetFile: FunctionsAndTypes.kt
PsiComment(EOL_COMMENT)('//type Runnable = {() => ()}')
PsiWhiteSpace('\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Function1')
TYPE_PARAMETER_LIST
@@ -1,4 +1,4 @@
type Comparison<in T> = (T, T) -> Int
typealias Comparison<in T> = (T, T) -> Int
fun naturalOrder<in T : Comparable<T>>(a : T, b : T) : Int = a.compareTo(b)
@@ -8,7 +8,7 @@ enum class ComparisonResult {
LS; EQ; GR
}
type MatchableComparison<in T> = (T, T) -> ComparisonResult
typealias MatchableComparison<in T> = (T, T) -> ComparisonResult
fun asMatchableComparison<T>(cmp : Comparison<T>) : MatchableComparison<T> = {(a, b) ->
val res = cmp(a, b)
@@ -2,7 +2,7 @@ JetFile: Comparison.kt
PACKAGE_DIRECTIVE
<empty list>
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Comparison')
TYPE_PARAMETER_LIST
@@ -231,7 +231,7 @@ JetFile: Comparison.kt
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n')
TYPEDEF
PsiElement(type)('type')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('MatchableComparison')
TYPE_PARAMETER_LIST