Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
2e8b828e
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2e8b828e
编写于
3月 15, 2011
作者:
A
Andrey Breslav
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resolve for "!"
上级
68d60f2b
变更
33
展开全部
隐藏空白更改
内联
并排
Showing
33 changed file
with
794 addition
and
572 deletion
+794
-572
idea/src/jet/lang/Library.jet
idea/src/jet/lang/Library.jet
+39
-9
idea/src/org/jetbrains/jet/lang/annotations/LabelsAnnotator.java
...c/org/jetbrains/jet/lang/annotations/LabelsAnnotator.java
+3
-3
idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java
.../org/jetbrains/jet/lang/parsing/JetExpressionParsing.java
+10
-5
idea/src/org/jetbrains/jet/lang/psi/JetNamedDeclaration.java
idea/src/org/jetbrains/jet/lang/psi/JetNamedDeclaration.java
+3
-1
idea/src/org/jetbrains/jet/lang/psi/JetPostfixExpression.java
.../src/org/jetbrains/jet/lang/psi/JetPostfixExpression.java
+3
-12
idea/src/org/jetbrains/jet/lang/psi/JetPrefixExpression.java
idea/src/org/jetbrains/jet/lang/psi/JetPrefixExpression.java
+10
-14
idea/src/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver.java
...g/jetbrains/jet/lang/resolve/ClassDescriptorResolver.java
+21
-10
idea/src/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.java
...etbrains/jet/lang/resolve/java/JavaClassMembersScope.java
+7
-1
idea/src/org/jetbrains/jet/lang/types/ClassDescriptorImpl.java
...src/org/jetbrains/jet/lang/types/ClassDescriptorImpl.java
+1
-1
idea/src/org/jetbrains/jet/lang/types/ErrorType.java
idea/src/org/jetbrains/jet/lang/types/ErrorType.java
+1
-1
idea/src/org/jetbrains/jet/lang/types/JetTypeInferrer.java
idea/src/org/jetbrains/jet/lang/types/JetTypeInferrer.java
+474
-392
idea/src/org/jetbrains/jet/lang/types/TypeConstructor.java
idea/src/org/jetbrains/jet/lang/types/TypeConstructor.java
+5
-42
idea/src/org/jetbrains/jet/lang/types/TypeConstructorImpl.java
...src/org/jetbrains/jet/lang/types/TypeConstructorImpl.java
+64
-0
idea/src/org/jetbrains/jet/lang/types/TypeParameterDescriptor.java
...org/jetbrains/jet/lang/types/TypeParameterDescriptor.java
+1
-1
idea/src/org/jetbrains/jet/lang/types/TypeUtils.java
idea/src/org/jetbrains/jet/lang/types/TypeUtils.java
+1
-1
idea/testData/psi/CallsInWhen.txt
idea/testData/psi/CallsInWhen.txt
+4
-2
idea/testData/psi/ControlStructures.txt
idea/testData/psi/ControlStructures.txt
+4
-2
idea/testData/psi/EOLsInComments.txt
idea/testData/psi/EOLsInComments.txt
+12
-6
idea/testData/psi/Labels.txt
idea/testData/psi/Labels.txt
+32
-16
idea/testData/psi/NewlinesInParentheses.txt
idea/testData/psi/NewlinesInParentheses.txt
+10
-5
idea/testData/psi/Precedence.txt
idea/testData/psi/Precedence.txt
+18
-9
idea/testData/psi/SimpleExpressions.txt
idea/testData/psi/SimpleExpressions.txt
+4
-2
idea/testData/psi/examples/AnonymousObjects.txt
idea/testData/psi/examples/AnonymousObjects.txt
+2
-1
idea/testData/psi/examples/BinaryTree.txt
idea/testData/psi/examples/BinaryTree.txt
+18
-9
idea/testData/psi/examples/Graph.txt
idea/testData/psi/examples/Graph.txt
+6
-3
idea/testData/psi/examples/UpdateOperation.txt
idea/testData/psi/examples/UpdateOperation.txt
+2
-1
idea/testData/psi/examples/collections/ArrayList.txt
idea/testData/psi/examples/collections/ArrayList.txt
+6
-3
idea/testData/psi/examples/collections/IIterator.txt
idea/testData/psi/examples/collections/IIterator.txt
+4
-2
idea/testData/psi/examples/collections/LinkedList.txt
idea/testData/psi/examples/collections/LinkedList.txt
+4
-2
idea/testData/psi/examples/io/IOSamples.txt
idea/testData/psi/examples/io/IOSamples.txt
+6
-3
idea/testData/psi/examples/priorityqueues/BinaryHeap.txt
idea/testData/psi/examples/priorityqueues/BinaryHeap.txt
+2
-1
idea/testData/resolve/ResolveOfInfixExpressions.jet
idea/testData/resolve/ResolveOfInfixExpressions.jet
+6
-1
idea/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java
idea/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java
+11
-11
未找到文件。
idea/src/jet/lang/Library.jet
浏览文件 @
2e8b828e
...
...
@@ -5,39 +5,58 @@ class Array<T> {
fun set(index : Int, value : T) : Unit
}
class Boolean {
virtual class Comparable<in T> {
fun compareTo(other : T) : Int
}
class String {
class Boolean : Comparable<Boolean> {
fun not() : Boolean
}
class String : Comparable<String> {
fun get(index : Int) : Char
val length : Int
fun plus(other : Any?) : String
}
class Double {
class Double
: Comparable<Double>
{
fun plus(other : Double) : Double
}
class Float {
class Float : Comparable<Float> {
fun compareTo(other : Double) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
}
class Long {
class Long : Comparable<Long> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
}
class Int {
class Int : Comparable<Int> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
fun plus(other : Int) : Int
}
class Char {
class Char : Comparable<Char> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
...
...
@@ -45,7 +64,12 @@ class Char {
fun plus(other : Char) : Char
}
class Short {
class Short : Comparable<Char> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
...
...
@@ -53,7 +77,13 @@ class Short {
fun plus(other : Short) : Short
}
class Byte {
class Byte : Comparable<Char> {
fun compareTo(other : Double) : Int
fun compareTo(other : Float) : Int
fun compareTo(other : Long) : Int
fun compareTo(other : Int) : Int
fun compareTo(other : Short) : Int
fun plus(other : Double) : Double
fun plus(other : Float) : Float
fun plus(other : Long) : Long
...
...
idea/src/org/jetbrains/jet/lang/annotations/LabelsAnnotator.java
浏览文件 @
2e8b828e
...
...
@@ -17,9 +17,9 @@ public class LabelsAnnotator implements Annotator {
element
.
accept
(
new
JetVisitor
()
{
@Override
public
void
visitPrefixExpression
(
JetPrefixExpression
expression
)
{
ASTNode
operationTokenNode
=
expression
.
getOperationTokenNode
();
if
(
JetTokens
.
LABELS
.
contains
(
operation
TokenNode
.
get
ElementType
()))
{
holder
.
createInfoAnnotation
(
operation
TokenNode
,
null
).
setTextAttributes
(
JetHighlighter
.
JET_LABEL_IDENTIFIER
);
JetSimpleNameExpression
operationSign
=
expression
.
getOperationSign
();
if
(
JetTokens
.
LABELS
.
contains
(
operation
Sign
.
getReferencedName
ElementType
()))
{
holder
.
createInfoAnnotation
(
operation
Sign
,
null
).
setTextAttributes
(
JetHighlighter
.
JET_LABEL_IDENTIFIER
);
}
}
...
...
idea/src/org/jetbrains/jet/lang/parsing/JetExpressionParsing.java
浏览文件 @
2e8b828e
...
...
@@ -263,9 +263,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
while
(!
myBuilder
.
newlineBeforeCurrentToken
()
&&
atSet
(
precedence
.
getOperations
()))
{
IElementType
operation
=
tt
();
PsiBuilder
.
Marker
operationReference
=
mark
();
advance
();
// operation
operationReference
.
done
(
OPERATION_REFERENCE
);
parseOperationReference
();
JetNodeType
resultType
=
precedence
.
parseRightHandSide
(
operation
,
this
);
expression
.
done
(
resultType
);
...
...
@@ -291,7 +289,8 @@ public class JetExpressionParsing extends AbstractJetParsing {
}
}
else
if
(
atSet
(
Precedence
.
PREFIX
.
getOperations
()))
{
PsiBuilder
.
Marker
expression
=
mark
();
advance
();
// operation
parseOperationReference
();
parsePrefixExpression
();
expression
.
done
(
PREFIX_EXPRESSION
);
...
...
@@ -323,7 +322,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
parseArrayAccess
();
expression
.
done
(
ARRAY_ACCESS_EXPRESSION
);
}
else
if
(
atSet
(
Precedence
.
POSTFIX
.
getOperations
()))
{
advance
();
// operation
parseOperationReference
();
expression
.
done
(
POSTFIX_EXPRESSION
);
}
else
if
(
parseCallWithClosure
())
{
parseCallWithClosure
();
...
...
@@ -380,6 +379,12 @@ public class JetExpressionParsing extends AbstractJetParsing {
expression
.
drop
();
}
private
void
parseOperationReference
()
{
PsiBuilder
.
Marker
operationReference
=
mark
();
advance
();
// operation
operationReference
.
done
(
OPERATION_REFERENCE
);
}
/*
* expression (label? functionLiteral)?
*/
...
...
idea/src/org/jetbrains/jet/lang/psi/JetNamedDeclaration.java
浏览文件 @
2e8b828e
...
...
@@ -40,7 +40,9 @@ public abstract class JetNamedDeclaration extends JetDeclaration implements PsiN
@Override
public
TextRange
getRangeInElement
()
{
return
getElement
().
getTextRange
().
shiftRight
(
getElement
().
getTextOffset
());
PsiElement
element
=
getElement
();
if
(
element
==
null
)
return
null
;
return
element
.
getTextRange
().
shiftRight
(
element
.
getTextOffset
());
}
@Override
...
...
idea/src/org/jetbrains/jet/lang/psi/JetPostfixExpression.java
浏览文件 @
2e8b828e
...
...
@@ -2,9 +2,7 @@ package org.jetbrains.jet.lang.psi;
import
com.intellij.lang.ASTNode
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.jet.lexer.JetToken
;
import
org.jetbrains.jet.lexer.JetTokens
;
import
org.jetbrains.jet.JetNodeTypes
;
/**
* @author max
...
...
@@ -27,14 +25,7 @@ public class JetPostfixExpression extends JetExpression {
}
@NotNull
public
ASTNode
getOperationTokenNode
()
{
ASTNode
operationNode
=
getNode
().
findChildByType
(
JetTokens
.
OPERATIONS
);
assert
operationNode
!=
null
;
return
operationNode
;
}
@Nullable
public
JetToken
getOperationSign
()
{
return
(
JetToken
)
getOperationTokenNode
().
getElementType
();
public
JetSimpleNameExpression
getOperationSign
()
{
return
(
JetSimpleNameExpression
)
findChildByType
(
JetNodeTypes
.
OPERATION_REFERENCE
);
}
}
idea/src/org/jetbrains/jet/lang/psi/JetPrefixExpression.java
浏览文件 @
2e8b828e
package
org.jetbrains.jet.lang.psi
;
import
com.intellij.lang.ASTNode
;
import
com.intellij.psi.PsiElement
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.jet.lexer.JetToken
;
import
org.jetbrains.jet.lexer.JetTokens
;
import
org.jetbrains.jet.JetNodeTypes
;
/**
* @author max
...
...
@@ -20,20 +20,16 @@ public class JetPrefixExpression extends JetExpression {
@NotNull
public
JetExpression
getBaseExpression
()
{
JetExpression
answer
=
findChildByClass
(
JetExpression
.
class
);
assert
answer
!=
null
;
return
answer
;
PsiElement
expression
=
getOperationSign
().
getNextSibling
();
while
(
expression
!=
null
&&
false
==
expression
instanceof
JetExpression
)
{
expression
=
expression
.
getNextSibling
();
}
assert
expression
!=
null
;
return
(
JetExpression
)
expression
;
}
@NotNull
public
ASTNode
getOperationTokenNode
()
{
ASTNode
operationNode
=
getNode
().
findChildByType
(
JetTokens
.
OPERATIONS
);
assert
operationNode
!=
null
;
return
operationNode
;
}
@NotNull
public
JetToken
getOperationSign
()
{
return
(
JetToken
)
getOperationTokenNode
().
getElementType
();
public
JetSimpleNameExpression
getOperationSign
()
{
return
(
JetSimpleNameExpression
)
findChildByType
(
JetNodeTypes
.
OPERATION_REFERENCE
);
}
}
idea/src/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver.java
浏览文件 @
2e8b828e
...
...
@@ -61,22 +61,33 @@ public class ClassDescriptorResolver {
List
<
TypeParameterDescriptor
>
typeParameters
=
resolveTypeParameters
(
descriptor
,
parameterScope
,
classElement
.
getTypeParameters
());
boolean
open
=
classElement
.
hasModifier
(
JetTokens
.
OPEN_KEYWORD
);
List
<
JetType
>
supertypes
=
new
ArrayList
<
JetType
>();
TypeConstructorImpl
typeConstructor
=
new
TypeConstructorImpl
(
descriptor
,
AttributeResolver
.
INSTANCE
.
resolveAttributes
(
classElement
.
getModifierList
()),
!
open
,
classElement
.
getName
(),
typeParameters
,
supertypes
);
descriptor
.
setTypeConstructor
(
typeConstructor
);
List
<
JetDelegationSpecifier
>
delegationSpecifiers
=
classElement
.
getDelegationSpecifiers
();
// TODO : assuming that the hierarchy is acyclic
Collection
<?
extends
JetType
>
superclasses
=
delegationSpecifiers
.
isEmpty
()
?
Collections
.
singleton
(
JetStandardClasses
.
getAnyType
())
:
resolveTypes
(
parameterScope
,
delegationSpecifiers
);
boolean
open
=
classElement
.
hasModifier
(
JetTokens
.
OPEN_KEYWORD
);
descriptor
.
setTypeConstructor
(
new
TypeConstructor
(
descriptor
,
AttributeResolver
.
INSTANCE
.
resolveAttributes
(
classElement
.
getModifierList
()),
!
open
,
classElement
.
getName
(),
typeParameters
,
superclasses
)
);
// TODO : UGLY HACK
supertypes
.
addAll
(
superclasses
);
// TODO : importing may be a bad idea
for
(
JetType
supertype
:
superclasses
)
{
parameterScope
.
importScope
(
supertype
.
getMemberScope
());
}
trace
.
recordDeclarationResolution
(
classElement
,
descriptor
);
}
...
...
idea/src/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.java
浏览文件 @
2e8b828e
...
...
@@ -32,7 +32,13 @@ public class JavaClassMembersScope implements JetScope {
@Override
public
ClassDescriptor
getClass
(
@NotNull
String
name
)
{
throw
new
UnsupportedOperationException
();
// TODO
for
(
PsiClass
innerClass
:
psiClass
.
getAllInnerClasses
())
{
if
(
name
.
equals
(
innerClass
.
getName
()))
{
if
(
innerClass
.
hasModifierProperty
(
PsiModifier
.
STATIC
)
!=
staticMembers
)
return
null
;
return
semanticServices
.
getDescriptorResolver
().
resolveClass
(
innerClass
);
}
}
return
null
;
}
@Override
...
...
idea/src/org/jetbrains/jet/lang/types/ClassDescriptorImpl.java
浏览文件 @
2e8b828e
...
...
@@ -33,7 +33,7 @@ public class ClassDescriptorImpl extends DeclarationDescriptorImpl implements Cl
public
final
ClassDescriptorImpl
initialize
(
boolean
sealed
,
List
<
TypeParameterDescriptor
>
typeParameters
,
Collection
<?
extends
JetType
>
superclasses
,
JetScope
memberDeclarations
)
{
this
.
typeConstructor
=
new
TypeConstructor
(
this
,
getAttributes
(),
sealed
,
getName
(),
typeParameters
,
superclasses
);
this
.
typeConstructor
=
new
TypeConstructor
Impl
(
this
,
getAttributes
(),
sealed
,
getName
(),
typeParameters
,
superclasses
);
this
.
memberDeclarations
=
memberDeclarations
;
return
this
;
}
...
...
idea/src/org/jetbrains/jet/lang/types/ErrorType.java
浏览文件 @
2e8b828e
...
...
@@ -63,7 +63,7 @@ public class ErrorType {
}
private
static
JetType
createErrorType
(
String
debugMessage
,
JetScope
memberScope
)
{
return
new
ErrorTypeImpl
(
new
TypeConstructor
(
null
,
Collections
.<
Attribute
>
emptyList
(),
false
,
"[ERROR : "
+
debugMessage
+
"]"
,
Collections
.<
TypeParameterDescriptor
>
emptyList
(),
Collections
.<
JetType
>
emptyList
()),
memberScope
);
return
new
ErrorTypeImpl
(
new
TypeConstructor
Impl
(
null
,
Collections
.<
Attribute
>
emptyList
(),
false
,
"[ERROR : "
+
debugMessage
+
"]"
,
Collections
.<
TypeParameterDescriptor
>
emptyList
(),
Collections
.<
JetType
>
emptyList
()),
memberScope
);
}
public
static
JetType
createWrongVarianceErrorType
(
TypeProjection
value
)
{
...
...
idea/src/org/jetbrains/jet/lang/types/JetTypeInferrer.java
浏览文件 @
2e8b828e
此差异已折叠。
点击以展开。
idea/src/org/jetbrains/jet/lang/types/TypeConstructor.java
浏览文件 @
2e8b828e
...
...
@@ -3,58 +3,21 @@ package org.jetbrains.jet.lang.types;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
/**
* @author abreslav
*/
public
class
TypeConstructor
extends
AnnotatedImpl
{
private
final
List
<
TypeParameterDescriptor
>
parameters
;
private
final
Collection
<?
extends
JetType
>
supertypes
;
private
final
String
debugName
;
private
final
boolean
sealed
;
@Nullable
private
final
DeclarationDescriptor
declarationDescriptor
;
public
TypeConstructor
(
@Nullable
DeclarationDescriptor
declarationDescriptor
,
@NotNull
List
<
Attribute
>
attributes
,
boolean
sealed
,
@NotNull
String
debugName
,
@NotNull
List
<
TypeParameterDescriptor
>
parameters
,
@NotNull
Collection
<?
extends
JetType
>
supertypes
)
{
super
(
attributes
);
this
.
declarationDescriptor
=
declarationDescriptor
;
this
.
sealed
=
sealed
;
this
.
debugName
=
debugName
;
this
.
parameters
=
new
ArrayList
<
TypeParameterDescriptor
>(
parameters
);
this
.
supertypes
=
supertypes
;
}
public
interface
TypeConstructor
extends
Annotated
{
@NotNull
public
List
<
TypeParameterDescriptor
>
getParameters
()
{
return
parameters
;
}
List
<
TypeParameterDescriptor
>
getParameters
();
@NotNull
public
Collection
<?
extends
JetType
>
getSupertypes
()
{
return
supertypes
;
}
@Override
public
String
toString
()
{
return
debugName
;
}
Collection
<?
extends
JetType
>
getSupertypes
();
public
boolean
isSealed
()
{
return
sealed
;
}
boolean
isSealed
();
@Nullable
public
DeclarationDescriptor
getDeclarationDescriptor
()
{
return
declarationDescriptor
;
}
DeclarationDescriptor
getDeclarationDescriptor
();
}
idea/src/org/jetbrains/jet/lang/types/TypeConstructorImpl.java
0 → 100644
浏览文件 @
2e8b828e
package
org.jetbrains.jet.lang.types
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
/**
* @author abreslav
*/
public
class
TypeConstructorImpl
extends
AnnotatedImpl
implements
TypeConstructor
{
private
final
List
<
TypeParameterDescriptor
>
parameters
;
private
Collection
<?
extends
JetType
>
supertypes
;
private
final
String
debugName
;
private
final
boolean
sealed
;
@Nullable
private
final
DeclarationDescriptor
declarationDescriptor
;
public
TypeConstructorImpl
(
@Nullable
DeclarationDescriptor
declarationDescriptor
,
@NotNull
List
<
Attribute
>
attributes
,
boolean
sealed
,
@NotNull
String
debugName
,
@NotNull
List
<
TypeParameterDescriptor
>
parameters
,
@NotNull
Collection
<?
extends
JetType
>
supertypes
)
{
super
(
attributes
);
this
.
declarationDescriptor
=
declarationDescriptor
;
this
.
sealed
=
sealed
;
this
.
debugName
=
debugName
;
this
.
parameters
=
new
ArrayList
<
TypeParameterDescriptor
>(
parameters
);
this
.
supertypes
=
supertypes
;
}
@Override
@NotNull
public
List
<
TypeParameterDescriptor
>
getParameters
()
{
return
parameters
;
}
@Override
@NotNull
public
Collection
<?
extends
JetType
>
getSupertypes
()
{
return
supertypes
;
}
@Override
public
String
toString
()
{
return
debugName
;
}
@Override
public
boolean
isSealed
()
{
return
sealed
;
}
@Override
@Nullable
public
DeclarationDescriptor
getDeclarationDescriptor
()
{
return
declarationDescriptor
;
}
}
idea/src/org/jetbrains/jet/lang/types/TypeParameterDescriptor.java
浏览文件 @
2e8b828e
...
...
@@ -19,7 +19,7 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl {
this
.
variance
=
variance
;
this
.
upperBounds
=
upperBounds
;
// TODO: Should we actually pass the attributes on to the type constructor?
this
.
typeConstructor
=
new
TypeConstructor
(
this
.
typeConstructor
=
new
TypeConstructor
Impl
(
this
,
attributes
,
false
,
...
...
idea/src/org/jetbrains/jet/lang/types/TypeUtils.java
浏览文件 @
2e8b828e
...
...
@@ -56,7 +56,7 @@ public class TypeUtils {
}
List
<
Attribute
>
noAttributes
=
Collections
.<
Attribute
>
emptyList
();
TypeConstructor
constructor
=
new
TypeConstructor
(
null
,
noAttributes
,
false
,
debugName
.
toString
(),
Collections
.<
TypeParameterDescriptor
>
emptyList
(),
types
);
TypeConstructor
constructor
=
new
TypeConstructor
Impl
(
null
,
noAttributes
,
false
,
debugName
.
toString
(),
Collections
.<
TypeParameterDescriptor
>
emptyList
(),
types
);
return
new
JetTypeImpl
(
noAttributes
,
constructor
,
...
...
idea/testData/psi/CallsInWhen.txt
浏览文件 @
2e8b828e
...
...
@@ -148,7 +148,8 @@ JetFile: CallsInWhen.jet
PsiElement(LBRACE)('{')
BODY
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
PsiElement(RBRACE)('}')
...
...
@@ -171,7 +172,8 @@ JetFile: CallsInWhen.jet
PsiWhiteSpace(' ')
BODY
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
PsiElement(RBRACE)('}')
...
...
idea/testData/psi/ControlStructures.txt
浏览文件 @
2e8b828e
...
...
@@ -198,7 +198,8 @@ JetFile: ControlStructures.jet
PsiElement(break)('break')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@la')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@la')
PsiWhiteSpace('\n ')
BREAK
PsiElement(break)('break')
...
...
@@ -209,7 +210,8 @@ JetFile: ControlStructures.jet
PsiElement(continue)('continue')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@la')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@la')
PsiWhiteSpace('\n ')
CONTINUE
PsiElement(continue)('continue')
...
...
idea/testData/psi/EOLsInComments.txt
浏览文件 @
2e8b828e
...
...
@@ -17,7 +17,8 @@ JetFile: EOLsInComments.jet
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -27,7 +28,8 @@ JetFile: EOLsInComments.jet
PsiWhiteSpace('\n ')
PsiComment(DOC_COMMENT)('/** */')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -37,7 +39,8 @@ JetFile: EOLsInComments.jet
PsiWhiteSpace('\n ')
PsiComment(BLOCK_COMMENT)('/* */')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -60,7 +63,8 @@ JetFile: EOLsInComments.jet
PsiComment(BLOCK_COMMENT)('/*\n */')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -83,7 +87,8 @@ JetFile: EOLsInComments.jet
PsiComment(EOL_COMMENT)('//')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -94,7 +99,8 @@ JetFile: EOLsInComments.jet
PsiComment(EOL_COMMENT)('//')
PsiWhiteSpace('\n')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
idea/testData/psi/Labels.txt
浏览文件 @
2e8b828e
...
...
@@ -28,7 +28,8 @@ JetFile: Labels.jet
PARENTHESIZED
PsiElement(LPAR)('(')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@a')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
...
...
@@ -52,7 +53,8 @@ JetFile: Labels.jet
PARENTHESIZED
PsiElement(LPAR)('(')
PREFIX_EXPRESSION
PsiElement(AT)('@')
OPERATION_REFERENCE
PsiElement(AT)('@')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
...
...
@@ -63,7 +65,8 @@ JetFile: Labels.jet
PsiElement(AT)('@')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(AT)('@')
OPERATION_REFERENCE
PsiElement(AT)('@')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
...
...
@@ -86,7 +89,8 @@ JetFile: Labels.jet
PARENTHESIZED
PsiElement(LPAR)('(')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@a')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
...
...
@@ -97,7 +101,8 @@ JetFile: Labels.jet
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@a')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
...
...
@@ -120,7 +125,8 @@ JetFile: Labels.jet
PARENTHESIZED
PsiElement(LPAR)('(')
PREFIX_EXPRESSION
PsiElement(ATAT)('@@')
OPERATION_REFERENCE
PsiElement(ATAT)('@@')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
...
...
@@ -131,20 +137,23 @@ JetFile: Labels.jet
PsiElement(ATAT)('@@')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(ATAT)('@@')
OPERATION_REFERENCE
PsiElement(ATAT)('@@')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@a')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
PsiElement(ATAT)('@@')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@a')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
...
...
@@ -154,7 +163,8 @@ JetFile: Labels.jet
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@a')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
...
...
@@ -163,21 +173,24 @@ JetFile: Labels.jet
PARENTHESIZED
PsiElement(LPAR)('(')
PREFIX_EXPRESSION
PsiElement(ATAT)('@@')
OPERATION_REFERENCE
PsiElement(ATAT)('@@')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@a')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@a')
PsiWhiteSpace(' ')
RETURN
PsiElement(return)('return')
PsiElement(ATAT)('@@')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(ATAT)('@@')
OPERATION_REFERENCE
PsiElement(ATAT)('@@')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
...
...
@@ -221,7 +234,8 @@ JetFile: Labels.jet
PsiElement(IDENTIFIER)('filter')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@f')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@f')
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
...
...
@@ -257,7 +271,8 @@ JetFile: Labels.jet
PsiElement(IDENTIFIER)('filter')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(AT)('@')
OPERATION_REFERENCE
PsiElement(AT)('@')
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
...
...
@@ -293,7 +308,8 @@ JetFile: Labels.jet
PsiElement(IDENTIFIER)('filter')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(ATAT)('@@')
OPERATION_REFERENCE
PsiElement(ATAT)('@@')
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
...
...
idea/testData/psi/NewlinesInParentheses.txt
浏览文件 @
2e8b828e
...
...
@@ -58,7 +58,8 @@ JetFile: NewlinesInParentheses.jet
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -99,7 +100,8 @@ JetFile: NewlinesInParentheses.jet
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -123,7 +125,8 @@ JetFile: NewlinesInParentheses.jet
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
...
...
@@ -178,7 +181,8 @@ JetFile: NewlinesInParentheses.jet
PsiElement(IDENTIFIER)('c')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('d')
...
...
@@ -205,7 +209,8 @@ JetFile: NewlinesInParentheses.jet
PsiElement(IDENTIFIER)('c')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUS)('+')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('d')
...
...
idea/testData/psi/Precedence.txt
浏览文件 @
2e8b828e
...
...
@@ -28,7 +28,8 @@ JetFile: Precedence.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace(' ')
PsiElement(DOT)('.')
PsiWhiteSpace(' ')
...
...
@@ -36,13 +37,16 @@ JetFile: Precedence.jet
PsiElement(INTEGER_LITERAL)('4')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(MINUSMINUS)('--')
OPERATION_REFERENCE
PsiElement(MINUSMINUS)('--')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
...
...
@@ -433,10 +437,12 @@ JetFile: Precedence.jet
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(MINUSMINUS)('--')
OPERATION_REFERENCE
PsiElement(MINUSMINUS)('--')
POSTFIX_EXPRESSION
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
...
...
@@ -444,11 +450,13 @@ JetFile: Precedence.jet
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
PREFIX_EXPRESSION
PsiElement(MINUSMINUS)('--')
OPERATION_REFERENCE
PsiElement(MINUSMINUS)('--')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
...
...
@@ -940,7 +948,8 @@ JetFile: Precedence.jet
BINARY_EXPRESSION
BINARY_WITH_TYPE
PREFIX_EXPRESSION
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
PsiWhiteSpace(' ')
...
...
idea/testData/psi/SimpleExpressions.txt
浏览文件 @
2e8b828e
...
...
@@ -671,7 +671,8 @@ JetFile: SimpleExpressions.jet
PsiElement(break)('break')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@la')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@la')
PsiWhiteSpace('\n ')
BREAK
PsiElement(break)('break')
...
...
@@ -682,7 +683,8 @@ JetFile: SimpleExpressions.jet
PsiElement(continue)('continue')
PsiWhiteSpace('\n ')
PREFIX_EXPRESSION
PsiElement(LABEL_IDENTIFIER)('@la')
OPERATION_REFERENCE
PsiElement(LABEL_IDENTIFIER)('@la')
PsiWhiteSpace('\n ')
CONTINUE
PsiElement(continue)('continue')
...
...
idea/testData/psi/examples/AnonymousObjects.txt
浏览文件 @
2e8b828e
...
...
@@ -77,7 +77,8 @@ JetFile: AnonymousObjects.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('clickCount')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiElement(SEMICOLON)(';')
PsiWhiteSpace('\n ')
IF
...
...
idea/testData/psi/examples/BinaryTree.txt
浏览文件 @
2e8b828e
...
...
@@ -564,12 +564,14 @@ JetFile: BinaryTree.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('size')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('version')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
RETURN
PsiElement(return)('return')
...
...
@@ -1168,12 +1170,14 @@ JetFile: BinaryTree.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('size')
PsiElement(MINUSMINUS)('--')
OPERATION_REFERENCE
PsiElement(MINUSMINUS)('--')
PsiWhiteSpace('\n ')
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('version')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
RETURN
PsiElement(return)('return')
...
...
@@ -2048,7 +2052,8 @@ JetFile: BinaryTree.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('hasNext')
PsiElement(RPAR)(')')
...
...
@@ -2140,7 +2145,8 @@ JetFile: BinaryTree.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('down')
...
...
@@ -2400,7 +2406,8 @@ JetFile: BinaryTree.jet
PsiWhiteSpace(' ')
BINARY_EXPRESSION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('down')
...
...
@@ -2412,7 +2419,8 @@ JetFile: BinaryTree.jet
PsiElement(OROR)('||')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('up')
...
...
@@ -2486,7 +2494,8 @@ JetFile: BinaryTree.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('version')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
DOT_QIALIFIED_EXPRESSION
...
...
idea/testData/psi/examples/Graph.txt
浏览文件 @
2e8b828e
...
...
@@ -668,7 +668,8 @@ JetFile: Graph.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
CALL_EXPRESSION
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
...
...
@@ -852,7 +853,8 @@ JetFile: Graph.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
CALL_EXPRESSION
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
...
...
@@ -892,7 +894,8 @@ JetFile: Graph.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('pending')
...
...
idea/testData/psi/examples/UpdateOperation.txt
浏览文件 @
2e8b828e
...
...
@@ -211,7 +211,8 @@ JetFile: UpdateOperation.jet
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(MINUS)('-')
OPERATION_REFERENCE
PsiElement(MINUS)('-')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
...
...
idea/testData/psi/examples/collections/ArrayList.txt
浏览文件 @
2e8b828e
...
...
@@ -291,7 +291,8 @@ JetFile: ArrayList.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('index')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiElement(RBRACKET)(']')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
...
...
@@ -709,7 +710,8 @@ JetFile: ArrayList.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('used')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
...
...
@@ -819,7 +821,8 @@ JetFile: ArrayList.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('used')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
...
...
idea/testData/psi/examples/collections/IIterator.txt
浏览文件 @
2e8b828e
...
...
@@ -354,7 +354,8 @@ JetFile: IIterator.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('hasNext')
PsiElement(RPAR)(')')
...
...
@@ -389,7 +390,8 @@ JetFile: IIterator.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('count')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
...
...
idea/testData/psi/examples/collections/LinkedList.txt
浏览文件 @
2e8b828e
...
...
@@ -179,7 +179,8 @@ JetFile: LinkedList.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('size')
PsiElement(PLUSPLUS)('++')
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
PsiWhiteSpace('\n ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
...
...
@@ -682,7 +683,8 @@ JetFile: LinkedList.jet
POSTFIX_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('size')
PsiElement(MINUSMINUS)('--')
OPERATION_REFERENCE
PsiElement(MINUSMINUS)('--')
PsiWhiteSpace('\n ')
RETURN
PsiElement(return)('return')
...
...
idea/testData/psi/examples/io/IOSamples.txt
浏览文件 @
2e8b828e
...
...
@@ -355,7 +355,8 @@ JetFile: IOSamples.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('nextUsed')
PsiElement(RPAR)(')')
...
...
@@ -435,7 +436,8 @@ JetFile: IOSamples.jet
PsiElement(EXCLEQ)('!=')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(MINUS)('-')
OPERATION_REFERENCE
PsiElement(MINUS)('-')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
...
...
@@ -488,7 +490,8 @@ JetFile: IOSamples.jet
PsiElement(EXCLEQ)('!=')
PsiWhiteSpace(' ')
PREFIX_EXPRESSION
PsiElement(MINUS)('-')
OPERATION_REFERENCE
PsiElement(MINUS)('-')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace(' \n ')
...
...
idea/testData/psi/examples/priorityqueues/BinaryHeap.txt
浏览文件 @
2e8b828e
...
...
@@ -784,7 +784,8 @@ JetFile: BinaryHeap.jet
PsiElement(LPAR)('(')
CONDITION
PREFIX_EXPRESSION
PsiElement(EXCL)('!')
OPERATION_REFERENCE
PsiElement(EXCL)('!')
DOT_QIALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('current')
...
...
idea/testData/resolve/ResolveOfInfixExpressions.jet
浏览文件 @
2e8b828e
...
...
@@ -23,10 +23,14 @@ import util.*
~get3~fun get(i : Object) : Any {return i }
}
~Bar~class Bar : Foo {
~not~fun not() : String {}
}
fun <T> tt(t : T) : T {
val x : List = 0
x`java::java.util.List.get()`[1]
val foo = new
Foo
val foo = new
Bar
foo`!`[null, 1]
foo`get2`[1, 1]
foo`get1`[1]
...
...
@@ -36,4 +40,5 @@ fun <T> tt(t : T) : T {
(x`java::java.util.List.set()`[1]) = null
x`!`[null] = null
(x`!`[null, 2]) = null
(`not`!foo)[1]`:std::Char`
}
idea/tests/org/jetbrains/jet/types/JetTypeCheckerTest.java
浏览文件 @
2e8b828e
...
...
@@ -105,25 +105,25 @@ public class JetTypeCheckerTest extends LightDaemonAnalyzerTestCase {
assertType
(
"if (true) 1 else null"
,
"Int?"
);
assertType
(
"if (true) null else null"
,
"Nothing?"
);
assertType
(
"if (true) 1 else '1'"
,
"
Any
"
);
assertType
(
"if (true) 1 else '1'"
,
"
Comparable<out Any>
"
);
}
public
void
testWhen
()
throws
Exception
{
assertType
(
"when (1) { is 1 => 2; } "
,
"Int"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'} "
,
"
Any
"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; is 1 => null} "
,
"
Any
?"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; else => null} "
,
"
Any
?"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; else continue} "
,
"
Any
"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; is 1 when(e) {is 1 => null}} "
,
"
Any
?"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; is 1 => when(e) {is 1 => null}} "
,
"
Any
?"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'} "
,
"
Comparable<out Any>
"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; is 1 => null} "
,
"
Comparable<out Any>
?"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; else => null} "
,
"
Comparable<out Any>
?"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; else continue} "
,
"
Comparable<out Any>
"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; is 1 when(e) {is 1 => null}} "
,
"
Comparable<out Any>
?"
);
assertType
(
"when (1) { is 1 => 2; is 1 => '2'; is 1 => when(e) {is 1 => null}} "
,
"
Comparable<out Any>
?"
);
}
public
void
testTry
()
throws
Exception
{
assertType
(
"try {1} finally{2}"
,
"Int"
);
assertType
(
"try {1} catch (e : e) {'a'} finally{2}"
,
"Int"
);
assertType
(
"try {1} catch (e : e) {'a'} finally{'2'}"
,
"
Any
"
);
assertType
(
"try {1} catch (e : e) {'a'}"
,
"
Any
"
);
assertType
(
"try {1} catch (e : e) {'a'} catch (e : e) {null}"
,
"
Any
?"
);
assertType
(
"try {1} catch (e : e) {'a'} finally{'2'}"
,
"
Comparable<out Any>
"
);
assertType
(
"try {1} catch (e : e) {'a'}"
,
"
Comparable<out Any>
"
);
assertType
(
"try {1} catch (e : e) {'a'} catch (e : e) {null}"
,
"
Comparable<out Any>
?"
);
assertType
(
"try {} catch (e : e) {}"
,
"Unit"
);
}
...
...
@@ -137,7 +137,7 @@ public class JetTypeCheckerTest extends LightDaemonAnalyzerTestCase {
assertCommonSupertype
(
"Int?"
,
"Int"
,
"Nothing?"
);
assertCommonSupertype
(
"Nothing?"
,
"Nothing?"
,
"Nothing?"
);
assertCommonSupertype
(
"
Any
"
,
"Int"
,
"Char"
);
assertCommonSupertype
(
"
Comparable<out Any>
"
,
"Int"
,
"Char"
);
assertCommonSupertype
(
"Base_T<*>"
,
"Base_T<*>"
,
"Derived_T<*>"
);
assertCommonSupertype
(
"Any"
,
"Base_inT<*>"
,
"Derived_T<*>"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录