Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
0e4a7ebe
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,发现更多精彩内容 >>
提交
0e4a7ebe
编写于
11月 04, 2011
作者:
A
Andrey Breslav
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
isReified() for type parameters
上级
e225bf5e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
7 deletion
+24
-7
compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
...tbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
+1
-0
compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java
...tbrains/jet/lang/descriptors/TypeParameterDescriptor.java
+13
-3
compiler/frontend/src/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver.java
...g/jetbrains/jet/lang/resolve/ClassDescriptorResolver.java
+2
-0
compiler/frontend/src/org/jetbrains/jet/lang/types/DescriptorSubstitutor.java
...c/org/jetbrains/jet/lang/types/DescriptorSubstitutor.java
+1
-0
compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardClasses.java
.../src/org/jetbrains/jet/lang/types/JetStandardClasses.java
+4
-4
compiler/frontend/src/org/jetbrains/jet/resolve/DescriptorRenderer.java
...end/src/org/jetbrains/jet/resolve/DescriptorRenderer.java
+3
-0
未找到文件。
compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
浏览文件 @
0e4a7ebe
...
...
@@ -189,6 +189,7 @@ public class JavaDescriptorResolver {
TypeParameterDescriptor
typeParameterDescriptor
=
TypeParameterDescriptor
.
createForFurtherModification
(
owner
,
Collections
.<
AnnotationDescriptor
>
emptyList
(),
// TODO
false
,
Variance
.
INVARIANT
,
typeParameter
.
getName
(),
typeParameter
.
getIndex
()
...
...
compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java
浏览文件 @
0e4a7ebe
...
...
@@ -21,10 +21,11 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
public
static
TypeParameterDescriptor
createWithDefaultBound
(
@NotNull
DeclarationDescriptor
containingDeclaration
,
@NotNull
List
<
AnnotationDescriptor
>
annotations
,
boolean
reified
,
@NotNull
Variance
variance
,
@NotNull
String
name
,
int
index
)
{
TypeParameterDescriptor
typeParameterDescriptor
=
createForFurtherModification
(
containingDeclaration
,
annotations
,
variance
,
name
,
index
);
TypeParameterDescriptor
typeParameterDescriptor
=
createForFurtherModification
(
containingDeclaration
,
annotations
,
reified
,
variance
,
name
,
index
);
typeParameterDescriptor
.
addUpperBound
(
JetStandardClasses
.
getDefaultBound
());
return
typeParameterDescriptor
;
}
...
...
@@ -32,10 +33,11 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
public
static
TypeParameterDescriptor
createForFurtherModification
(
@NotNull
DeclarationDescriptor
containingDeclaration
,
@NotNull
List
<
AnnotationDescriptor
>
annotations
,
boolean
reified
,
@NotNull
Variance
variance
,
@NotNull
String
name
,
int
index
)
{
return
new
TypeParameterDescriptor
(
containingDeclaration
,
annotations
,
variance
,
name
,
index
);
return
new
TypeParameterDescriptor
(
containingDeclaration
,
annotations
,
reified
,
variance
,
name
,
index
);
}
private
final
int
index
;
...
...
@@ -47,9 +49,12 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
private
final
Set
<
JetType
>
classObjectUpperBounds
=
Sets
.
newLinkedHashSet
();
private
JetType
classObjectBoundsAsType
;
private
final
boolean
reified
;
private
TypeParameterDescriptor
(
@NotNull
DeclarationDescriptor
containingDeclaration
,
@NotNull
List
<
AnnotationDescriptor
>
annotations
,
boolean
reified
,
@NotNull
Variance
variance
,
@NotNull
String
name
,
int
index
)
{
...
...
@@ -57,6 +62,7 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
this
.
index
=
index
;
this
.
variance
=
variance
;
this
.
upperBounds
=
Sets
.
newLinkedHashSet
();
this
.
reified
=
reified
;
// TODO: Should we actually pass the annotations on to the type constructor?
this
.
typeConstructor
=
new
TypeConstructorImpl
(
this
,
...
...
@@ -67,6 +73,10 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
upperBounds
);
}
public
boolean
isReified
()
{
return
reified
;
}
public
Variance
getVariance
()
{
return
variance
;
}
...
...
@@ -162,6 +172,6 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
@NotNull
public
TypeParameterDescriptor
copy
(
@NotNull
DeclarationDescriptor
newOwner
)
{
return
new
TypeParameterDescriptor
(
newOwner
,
Lists
.
newArrayList
(
getAnnotations
()),
variance
,
getName
(),
index
);
return
new
TypeParameterDescriptor
(
newOwner
,
Lists
.
newArrayList
(
getAnnotations
()),
reified
,
variance
,
getName
(),
index
);
}
}
compiler/frontend/src/org/jetbrains/jet/lang/resolve/ClassDescriptorResolver.java
浏览文件 @
0e4a7ebe
...
...
@@ -50,6 +50,7 @@ public class ClassDescriptorResolver {
TypeParameterDescriptor
typeParameterDescriptor
=
TypeParameterDescriptor
.
createForFurtherModification
(
descriptor
,
annotationResolver
.
createAnnotationStubs
(
typeParameter
.
getModifierList
()),
true
,
typeParameter
.
getVariance
(),
JetPsiUtil
.
safeName
(
typeParameter
.
getName
()),
index
...
...
@@ -313,6 +314,7 @@ public class ClassDescriptorResolver {
TypeParameterDescriptor
typeParameterDescriptor
=
TypeParameterDescriptor
.
createForFurtherModification
(
containingDescriptor
,
annotationResolver
.
createAnnotationStubs
(
typeParameter
.
getModifierList
()),
true
,
typeParameter
.
getVariance
(),
JetPsiUtil
.
safeName
(
typeParameter
.
getName
()),
index
...
...
compiler/frontend/src/org/jetbrains/jet/lang/types/DescriptorSubstitutor.java
浏览文件 @
0e4a7ebe
...
...
@@ -40,6 +40,7 @@ public class DescriptorSubstitutor {
TypeParameterDescriptor
substituted
=
TypeParameterDescriptor
.
createForFurtherModification
(
newContainingDeclaration
,
descriptor
.
getAnnotations
(),
descriptor
.
isReified
(),
descriptor
.
getVariance
(),
descriptor
.
getName
(),
descriptor
.
getIndex
());
...
...
compiler/frontend/src/org/jetbrains/jet/lang/types/JetStandardClasses.java
浏览文件 @
0e4a7ebe
...
...
@@ -116,7 +116,7 @@ public class JetStandardClasses {
parameters
.
add
(
TypeParameterDescriptor
.
createWithDefaultBound
(
classDescriptor
,
Collections
.<
AnnotationDescriptor
>
emptyList
(),
Variance
.
OUT_VARIANCE
,
"T"
+
j
,
j
));
true
,
Variance
.
OUT_VARIANCE
,
"T"
+
j
,
j
));
}
TUPLE
[
i
]
=
classDescriptor
.
initialize
(
true
,
...
...
@@ -159,7 +159,7 @@ public class JetStandardClasses {
parameters
.
add
(
0
,
TypeParameterDescriptor
.
createWithDefaultBound
(
receiverFunction
,
Collections
.<
AnnotationDescriptor
>
emptyList
(),
Variance
.
IN_VARIANCE
,
"T"
,
0
));
true
,
Variance
.
IN_VARIANCE
,
"T"
,
0
));
RECEIVER_FUNCTION
[
i
]
=
receiverFunction
.
initialize
(
false
,
parameters
,
...
...
@@ -174,12 +174,12 @@ public class JetStandardClasses {
parameters
.
add
(
TypeParameterDescriptor
.
createWithDefaultBound
(
function
,
Collections
.<
AnnotationDescriptor
>
emptyList
(),
Variance
.
IN_VARIANCE
,
"P"
+
j
,
j
+
1
));
true
,
Variance
.
IN_VARIANCE
,
"P"
+
j
,
j
+
1
));
}
parameters
.
add
(
TypeParameterDescriptor
.
createWithDefaultBound
(
function
,
Collections
.<
AnnotationDescriptor
>
emptyList
(),
Variance
.
OUT_VARIANCE
,
"R"
,
parameterCount
+
1
));
true
,
Variance
.
OUT_VARIANCE
,
"R"
,
parameterCount
+
1
));
return
parameters
;
}
...
...
compiler/frontend/src/org/jetbrains/jet/resolve/DescriptorRenderer.java
浏览文件 @
0e4a7ebe
...
...
@@ -311,6 +311,9 @@ public class DescriptorRenderer implements Renderer {
}
protected
void
renderTypeParameter
(
TypeParameterDescriptor
descriptor
,
StringBuilder
builder
)
{
if
(!
descriptor
.
isReified
())
{
builder
.
append
(
renderKeyword
(
"erased"
)).
append
(
" "
);
}
renderName
(
descriptor
,
builder
);
if
(!
descriptor
.
getUpperBounds
().
isEmpty
())
{
JetType
bound
=
descriptor
.
getUpperBounds
().
iterator
().
next
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录