Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
37bc1068
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,发现更多精彩内容 >>
提交
37bc1068
编写于
5月 30, 2012
作者:
A
Andrey Breslav
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix instanceof checks after introducing the TypeParameterDescriptor interface
上级
ebb0d25b
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
21 addition
and
20 deletion
+21
-20
compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java
...kend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java
+2
-2
compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java
.../backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java
+3
-3
compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java
...d/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java
+1
-1
compiler/frontend/src/org/jetbrains/jet/lang/resolve/OverridingUtil.java
...nd/src/org/jetbrains/jet/lang/resolve/OverridingUtil.java
+1
-1
compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java
...tend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java
+7
-4
compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities.java
...solve/calls/inference/ConstraintSystemWithPriorities.java
+2
-3
compiler/frontend/src/org/jetbrains/jet/lang/types/SubstitutionUtils.java
...d/src/org/jetbrains/jet/lang/types/SubstitutionUtils.java
+1
-2
compiler/frontend/src/org/jetbrains/jet/lang/types/TypeUtils.java
.../frontend/src/org/jetbrains/jet/lang/types/TypeUtils.java
+1
-1
compiler/frontend/src/org/jetbrains/jet/resolve/DescriptorRenderer.java
...end/src/org/jetbrains/jet/resolve/DescriptorRenderer.java
+1
-1
idea/src/org/jetbrains/jet/plugin/JetDescriptorIconProvider.java
...c/org/jetbrains/jet/plugin/JetDescriptorIconProvider.java
+1
-1
idea/src/org/jetbrains/jet/plugin/completion/JetCompletionContributor.java
...rains/jet/plugin/completion/JetCompletionContributor.java
+1
-1
未找到文件。
compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java
浏览文件 @
37bc1068
...
...
@@ -1093,7 +1093,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
}
}
if
(
descriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
descriptor
instanceof
TypeParameterDescriptor
)
{
TypeParameterDescriptor
typeParameterDescriptor
=
(
TypeParameterDescriptor
)
descriptor
;
v
.
invokevirtual
(
"jet/TypeInfo"
,
"getClassObject"
,
"()Ljava/lang/Object;"
);
v
.
checkcast
(
asmType
(
typeParameterDescriptor
.
getClassObjectType
()));
...
...
@@ -2614,7 +2614,7 @@ If finally block is present, its last expression is the value of try expression.
JetExpression
left
=
expression
.
getLeft
();
JetType
leftType
=
bindingContext
.
get
(
BindingContext
.
EXPRESSION_TYPE
,
left
);
DeclarationDescriptor
descriptor
=
rightType
.
getConstructor
().
getDeclarationDescriptor
();
if
(
descriptor
instanceof
ClassDescriptor
||
descriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
descriptor
instanceof
ClassDescriptor
||
descriptor
instanceof
TypeParameterDescriptor
)
{
StackValue
value
=
genQualified
(
receiver
,
left
);
value
.
put
(
JetTypeMapper
.
boxType
(
value
.
type
),
v
);
assert
leftType
!=
null
;
...
...
compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java
浏览文件 @
37bc1068
...
...
@@ -463,7 +463,7 @@ public class JetTypeMapper {
return
asmType
;
}
if
(
descriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
descriptor
instanceof
TypeParameterDescriptor
)
{
Type
type
=
mapType
(((
TypeParameterDescriptor
)
descriptor
).
getUpperBoundsAsType
(),
kind
);
if
(
signatureVisitor
!=
null
)
{
...
...
@@ -722,7 +722,7 @@ public class JetTypeMapper {
signatureVisitor
.
writeInterfaceBoundEnd
();
}
}
if
(
jetType
.
getConstructor
().
getDeclarationDescriptor
()
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
jetType
.
getConstructor
().
getDeclarationDescriptor
()
instanceof
TypeParameterDescriptor
)
{
signatureVisitor
.
writeInterfaceBound
();
mapType
(
jetType
,
signatureVisitor
,
MapTypeMode
.
TYPE_PARAMETER
);
signatureVisitor
.
writeInterfaceBoundEnd
();
...
...
@@ -988,7 +988,7 @@ public class JetTypeMapper {
public
boolean
isGenericsArray
(
JetType
type
)
{
DeclarationDescriptor
declarationDescriptor
=
type
.
getConstructor
().
getDeclarationDescriptor
();
if
(
declarationDescriptor
instanceof
TypeParameterDescriptor
Impl
)
if
(
declarationDescriptor
instanceof
TypeParameterDescriptor
)
return
true
;
if
(
standardLibrary
.
getArray
().
equals
(
declarationDescriptor
))
...
...
compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java
浏览文件 @
37bc1068
...
...
@@ -236,7 +236,7 @@ public class DescriptorUtils {
ClassDescriptor
clazz
=
(
ClassDescriptor
)
classifier
;
return
clazz
.
getKind
()
==
ClassKind
.
OBJECT
||
clazz
.
getKind
()
==
ClassKind
.
ENUM_ENTRY
;
}
else
if
(
classifier
instanceof
TypeParameterDescriptor
Impl
)
{
else
if
(
classifier
instanceof
TypeParameterDescriptor
)
{
return
false
;
}
else
{
...
...
compiler/frontend/src/org/jetbrains/jet/lang/resolve/OverridingUtil.java
浏览文件 @
37bc1068
...
...
@@ -212,7 +212,7 @@ public class OverridingUtil {
if
(
type
.
getConstructor
().
getDeclarationDescriptor
()
instanceof
ClassDescriptor
)
{
return
type
;
}
else
if
(
type
.
getConstructor
().
getDeclarationDescriptor
()
instanceof
TypeParameterDescriptor
Impl
)
{
else
if
(
type
.
getConstructor
().
getDeclarationDescriptor
()
instanceof
TypeParameterDescriptor
)
{
return
((
TypeParameterDescriptor
)
type
.
getConstructor
().
getDeclarationDescriptor
()).
getUpperBoundsAsType
();
}
else
{
...
...
compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java
浏览文件 @
37bc1068
...
...
@@ -18,14 +18,16 @@ package org.jetbrains.jet.lang.resolve;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.jet.lang.descriptors.*
;
import
org.jetbrains.jet.lang.descriptors.ClassDescriptor
;
import
org.jetbrains.jet.lang.descriptors.ClassifierDescriptor
;
import
org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
;
import
org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor
;
import
org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor
;
import
org.jetbrains.jet.lang.psi.*
;
import
org.jetbrains.jet.lang.resolve.scopes.JetScope
;
import
org.jetbrains.jet.lang.resolve.scopes.LazyScopeAdapter
;
import
org.jetbrains.jet.lang.types.*
;
import
org.jetbrains.jet.lang.types.lang.JetStandardClasses
;
import
org.jetbrains.jet.lang.types.ref.JetTypeName
;
import
org.jetbrains.jet.util.lazy.LazyValue
;
import
javax.inject.Inject
;
...
...
@@ -34,7 +36,8 @@ import java.util.Collection;
import
java.util.Collections
;
import
java.util.List
;
import
static
org
.
jetbrains
.
jet
.
lang
.
diagnostics
.
Errors
.*;
import
static
org
.
jetbrains
.
jet
.
lang
.
diagnostics
.
Errors
.
UNSUPPORTED
;
import
static
org
.
jetbrains
.
jet
.
lang
.
diagnostics
.
Errors
.
WRONG_NUMBER_OF_TYPE_ARGUMENTS
;
/**
* @author abreslav
...
...
@@ -96,7 +99,7 @@ public class TypeResolver {
return
;
}
if
(
classifierDescriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
classifierDescriptor
instanceof
TypeParameterDescriptor
)
{
TypeParameterDescriptor
typeParameterDescriptor
=
(
TypeParameterDescriptor
)
classifierDescriptor
;
trace
.
record
(
BindingContext
.
REFERENCE_TARGET
,
referenceExpression
,
typeParameterDescriptor
);
...
...
compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities.java
浏览文件 @
37bc1068
...
...
@@ -21,7 +21,6 @@ import com.google.common.collect.Sets;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
;
import
org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor
;
import
org.jetbrains.jet.lang.descriptors.TypeParameterDescriptorImpl
;
import
org.jetbrains.jet.lang.types.*
;
import
org.jetbrains.jet.lang.types.checker.JetTypeChecker
;
import
org.jetbrains.jet.lang.types.checker.TypeCheckingProcedure
;
...
...
@@ -89,7 +88,7 @@ public class ConstraintSystemWithPriorities implements ConstraintSystem {
@NotNull
private
TypeValue
getTypeValueFor
(
@NotNull
JetType
type
)
{
DeclarationDescriptor
declarationDescriptor
=
type
.
getConstructor
().
getDeclarationDescriptor
();
if
(
declarationDescriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
declarationDescriptor
instanceof
TypeParameterDescriptor
)
{
TypeParameterDescriptor
typeParameterDescriptor
=
(
TypeParameterDescriptor
)
declarationDescriptor
;
// Checking that this is not a T?, but exactly T
if
(
typeParameterDescriptor
.
getDefaultType
().
isNullable
()
==
type
.
isNullable
())
{
...
...
@@ -489,7 +488,7 @@ public class ConstraintSystemWithPriorities implements ConstraintSystem {
@Override
public
TypeProjection
get
(
TypeConstructor
key
)
{
DeclarationDescriptor
declarationDescriptor
=
key
.
getDeclarationDescriptor
();
if
(
declarationDescriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
declarationDescriptor
instanceof
TypeParameterDescriptor
)
{
TypeParameterDescriptor
descriptor
=
(
TypeParameterDescriptor
)
declarationDescriptor
;
if
(!
unknownTypes
.
containsKey
(
descriptor
))
return
null
;
...
...
compiler/frontend/src/org/jetbrains/jet/lang/types/SubstitutionUtils.java
浏览文件 @
37bc1068
...
...
@@ -21,7 +21,6 @@ import com.google.common.collect.Multimap;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor
;
import
org.jetbrains.jet.lang.descriptors.TypeParameterDescriptorImpl
;
import
org.jetbrains.jet.lang.types.lang.JetStandardClasses
;
import
org.jetbrains.jet.util.CommonSuppliers
;
...
...
@@ -112,7 +111,7 @@ public class SubstitutionUtils {
}
public
static
boolean
hasUnsubstitutedTypeParameters
(
JetType
type
)
{
if
(
type
.
getConstructor
().
getDeclarationDescriptor
()
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
type
.
getConstructor
().
getDeclarationDescriptor
()
instanceof
TypeParameterDescriptor
)
{
return
true
;
}
...
...
compiler/frontend/src/org/jetbrains/jet/lang/types/TypeUtils.java
浏览文件 @
37bc1068
...
...
@@ -219,7 +219,7 @@ public class TypeUtils {
private
static
void
processAllTypeParameters
(
JetType
type
,
Variance
howThiTypeIsUsed
,
Processor
<
TypeParameterUsage
>
result
)
{
ClassifierDescriptor
descriptor
=
type
.
getConstructor
().
getDeclarationDescriptor
();
if
(
descriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
descriptor
instanceof
TypeParameterDescriptor
)
{
result
.
process
(
new
TypeParameterUsage
((
TypeParameterDescriptor
)
descriptor
,
howThiTypeIsUsed
));
}
for
(
TypeProjection
projection
:
type
.
getArguments
())
{
...
...
compiler/frontend/src/org/jetbrains/jet/resolve/DescriptorRenderer.java
浏览文件 @
37bc1068
...
...
@@ -146,7 +146,7 @@ public class DescriptorRenderer implements Renderer<DeclarationDescriptor> {
Object
typeNameObject
;
if
(
cd
==
null
||
cd
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
cd
==
null
||
cd
instanceof
TypeParameterDescriptor
)
{
typeNameObject
=
type
.
getConstructor
();
}
else
{
...
...
idea/src/org/jetbrains/jet/plugin/JetDescriptorIconProvider.java
浏览文件 @
37bc1068
...
...
@@ -115,7 +115,7 @@ public final class JetDescriptorIconProvider {
return
((
VariableDescriptor
)
descriptor
).
isVar
()
?
JetIcons
.
FIELD_VAR
:
JetIcons
.
FIELD_VAL
;
}
if
(
descriptor
instanceof
TypeParameterDescriptor
Impl
)
{
if
(
descriptor
instanceof
TypeParameterDescriptor
)
{
return
PlatformIcons
.
CLASS_ICON
;
}
...
...
idea/src/org/jetbrains/jet/plugin/completion/JetCompletionContributor.java
浏览文件 @
37bc1068
...
...
@@ -185,7 +185,7 @@ public class JetCompletionContributor extends CompletionContributor {
DeclarationDescriptor
descriptor
=
((
JetLookupObject
)
object
).
getDescriptor
();
return
(
descriptor
instanceof
ClassDescriptor
)
||
(
descriptor
instanceof
NamespaceDescriptor
)
||
(
descriptor
instanceof
TypeParameterDescriptor
Impl
);
(
descriptor
instanceof
TypeParameterDescriptor
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录