Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
de3ba203
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,发现更多精彩内容 >>
提交
de3ba203
编写于
1月 13, 2012
作者:
S
Stepan Koltsov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test TypeParameterDescriptor index in ReadClassDataTest
(and fix index parsing)
上级
8055cf07
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
6 deletion
+12
-6
compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
...tbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
+10
-6
compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java
...tbrains/jet/lang/descriptors/TypeParameterDescriptor.java
+1
-0
compiler/tests/org/jetbrains/jet/ReadClassDataTest.java
compiler/tests/org/jetbrains/jet/ReadClassDataTest.java
+1
-0
未找到文件。
compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.java
浏览文件 @
de3ba203
...
...
@@ -376,11 +376,12 @@ public class JavaDescriptorResolver {
private
final
DeclarationDescriptor
containingDeclaration
;
private
final
PsiTypeParameterListOwner
psiOwner
;
private
final
String
name
;
private
final
int
index
;
private
final
TypeInfoVariance
variance
;
private
final
TypeVariableResolver
typeVariableResolver
;
protected
JetSignatureTypeParameterVisitor
(
DeclarationDescriptor
containingDeclaration
,
PsiTypeParameterListOwner
psiOwner
,
String
name
,
TypeInfoVariance
variance
,
TypeVariableResolver
typeVariableResolver
)
String
name
,
int
index
,
TypeInfoVariance
variance
,
TypeVariableResolver
typeVariableResolver
)
{
if
(
name
.
isEmpty
())
{
throw
new
IllegalStateException
();
...
...
@@ -389,12 +390,11 @@ public class JavaDescriptorResolver {
this
.
containingDeclaration
=
containingDeclaration
;
this
.
psiOwner
=
psiOwner
;
this
.
name
=
name
;
this
.
index
=
index
;
this
.
variance
=
variance
;
this
.
typeVariableResolver
=
typeVariableResolver
;
}
int
index
=
0
;
List
<
JetType
>
upperBounds
=
new
ArrayList
<
JetType
>();
List
<
JetType
>
lowerBounds
=
new
ArrayList
<
JetType
>();
...
...
@@ -429,7 +429,7 @@ public class JavaDescriptorResolver {
true
,
// TODO: wrong
JetSignatureUtils
.
translateVariance
(
variance
),
name
,
++
index
);
index
);
PsiTypeParameter
psiTypeParameter
=
getPsiTypeParameterByName
(
psiOwner
,
name
);
typeParameterDescriptorCache
.
put
(
psiTypeParameter
,
new
TypeParameterDescriptorInitialization
(
typeParameter
,
upperBounds
,
lowerBounds
));
done
(
typeParameter
);
...
...
@@ -460,9 +460,11 @@ public class JavaDescriptorResolver {
}
new
JetSignatureReader
(
jetSignature
).
accept
(
new
JetSignatureExceptionsAdapter
()
{
private
int
formalTypeParameterIndex
=
0
;
@Override
public
JetSignatureVisitor
visitFormalTypeParameter
(
final
String
name
,
final
TypeInfoVariance
variance
)
{
return
new
JetSignatureTypeParameterVisitor
(
classDescriptor
,
clazz
,
name
,
variance
,
new
MyTypeVariableResolver
())
{
return
new
JetSignatureTypeParameterVisitor
(
classDescriptor
,
clazz
,
name
,
formalTypeParameterIndex
++,
variance
,
new
MyTypeVariableResolver
())
{
@Override
protected
void
done
(
TypeParameterDescriptor
typeParameterDescriptor
)
{
r
.
add
(
typeParameterDescriptor
);
...
...
@@ -1314,10 +1316,12 @@ public class JavaDescriptorResolver {
}
new
JetSignatureReader
(
jetSignature
).
acceptFormalTypeParametersOnly
(
new
JetSignatureExceptionsAdapter
()
{
private
int
formalTypeParameterIndex
=
0
;
@Override
public
JetSignatureVisitor
visitFormalTypeParameter
(
final
String
name
,
final
TypeInfoVariance
variance
)
{
return
new
JetSignatureTypeParameterVisitor
(
functionDescriptor
,
method
,
name
,
variance
,
new
MyTypeVariableResolver
())
{
return
new
JetSignatureTypeParameterVisitor
(
functionDescriptor
,
method
,
name
,
formalTypeParameterIndex
++,
variance
,
new
MyTypeVariableResolver
())
{
@Override
protected
void
done
(
TypeParameterDescriptor
typeParameterDescriptor
)
{
r
.
add
(
typeParameterDescriptor
);
...
...
compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java
浏览文件 @
de3ba203
...
...
@@ -42,6 +42,7 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
return
new
TypeParameterDescriptor
(
containingDeclaration
,
annotations
,
reified
,
variance
,
name
,
index
);
}
// 0-based
private
final
int
index
;
private
final
Variance
variance
;
private
final
Set
<
JetType
>
upperBounds
;
...
...
compiler/tests/org/jetbrains/jet/ReadClassDataTest.java
浏览文件 @
de3ba203
...
...
@@ -446,6 +446,7 @@ public class ReadClassDataTest extends TestCaseWithTmpdir {
}
public
void
serialize
(
TypeParameterDescriptor
param
)
{
sb
.
append
(
"/*"
).
append
(
param
.
getIndex
()).
append
(
"*/ "
);
serialize
(
param
.
getVariance
());
sb
.
append
(
param
.
getName
());
if
(!
param
.
getUpperBounds
().
isEmpty
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录