Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
b5d3f9ee
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,体验更适合开发者的 AI 搜索 >>
提交
b5d3f9ee
编写于
3月 18, 2021
作者:
V
Victor Petukhov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename CoroutineInferenceSession to BuilderInferenceSession
上级
7a66e22b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
15 deletion
+15
-15
compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/BuilderInferenceSession.kt
...kotlin/resolve/calls/inference/BuilderInferenceSession.kt
+6
-6
compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt
...tlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt
+2
-2
compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt
...kotlin/types/expressions/DoubleColonExpressionResolver.kt
+2
-2
compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingServices.java
...ns/kotlin/types/expressions/ExpressionTypingServices.java
+2
-2
compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorForStatements.java
...pes/expressions/ExpressionTypingVisitorForStatements.java
+3
-3
未找到文件。
compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/
Coroutine
InferenceSession.kt
→
compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/
Builder
InferenceSession.kt
浏览文件 @
b5d3f9ee
...
...
@@ -36,7 +36,7 @@ import org.jetbrains.kotlin.types.expressions.ExpressionTypingServices
import
org.jetbrains.kotlin.types.typeUtil.contains
import
org.jetbrains.kotlin.utils.addToStdlib.cast
class
Coroutine
InferenceSession
(
class
Builder
InferenceSession
(
psiCallResolver
:
PSICallResolver
,
postponedArgumentsAnalyzer
:
PostponedArgumentsAnalyzer
,
kotlinConstraintSystemCompleter
:
KotlinConstraintSystemCompleter
,
...
...
@@ -56,10 +56,10 @@ class CoroutineInferenceSession(
)
:
ManyCandidatesResolver
<
CallableDescriptor
>(
psiCallResolver
,
postponedArgumentsAnalyzer
,
kotlinConstraintSystemCompleter
,
callComponents
,
builtIns
)
{
var
nestedBuilderInferenceSession
:
Coroutine
InferenceSession
?
=
null
var
nestedBuilderInferenceSession
:
Builder
InferenceSession
?
=
null
init
{
if
(
topLevelCallContext
.
inferenceSession
is
Coroutine
InferenceSession
)
{
if
(
topLevelCallContext
.
inferenceSession
is
Builder
InferenceSession
)
{
topLevelCallContext
.
inferenceSession
.
nestedBuilderInferenceSession
=
this
}
}
...
...
@@ -147,7 +147,7 @@ class CoroutineInferenceSession(
descriptor
.
extensionReceiverParameter
?.
type
?.
contains
{
it
is
StubType
}
==
true
}
private
fun
isTopLevelBuilderInferenceCall
()
=
topLevelCallContext
.
inferenceSession
!
is
Coroutine
InferenceSession
private
fun
isTopLevelBuilderInferenceCall
()
=
topLevelCallContext
.
inferenceSession
!
is
Builder
InferenceSession
fun
hasInapplicableCall
():
Boolean
=
hasInapplicableCall
...
...
@@ -234,7 +234,7 @@ class CoroutineInferenceSession(
bindings
[
nonFixedType
.
constructor
]
=
variable
.
defaultType
}
val
parentBuilderInferenceCallSession
=
topLevelCallContext
.
inferenceSession
as
?
Coroutine
InferenceSession
val
parentBuilderInferenceCallSession
=
topLevelCallContext
.
inferenceSession
as
?
Builder
InferenceSession
if
(
parentBuilderInferenceCallSession
!=
null
)
{
bindings
.
putAll
(
parentBuilderInferenceCallSession
.
createNonFixedTypeToVariableMap
())
...
...
@@ -399,7 +399,7 @@ class CoroutineInferenceSession(
}
companion
object
{
private
fun
Coroutine
InferenceSession
.
updateCalls
(
private
fun
Builder
InferenceSession
.
updateCalls
(
lambda
:
ResolvedLambdaAtom
,
substitutor
:
NewTypeSubstitutor
,
errors
:
List
<
ConstraintSystemError
>
...
...
compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt
浏览文件 @
b5d3f9ee
...
...
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.resolve.calls.ArgumentTypeResolver
import
org.jetbrains.kotlin.resolve.calls.components.*
import
org.jetbrains.kotlin.resolve.calls.context.BasicCallResolutionContext
import
org.jetbrains.kotlin.resolve.calls.context.ContextDependency
import
org.jetbrains.kotlin.resolve.calls.inference.
Coroutine
InferenceSession
import
org.jetbrains.kotlin.resolve.calls.inference.
Builder
InferenceSession
import
org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintSystemCompleter
import
org.jetbrains.kotlin.resolve.calls.inference.model.NewTypeVariable
import
org.jetbrains.kotlin.resolve.calls.model.*
...
...
@@ -162,7 +162,7 @@ class KotlinResolutionCallbacksImpl(
if
(
stubsForPostponedVariables
.
isNotEmpty
())
{
require
(
topLevelCallContext
!=
null
)
{
"Top level call context should not be null to analyze coroutine-lambda"
}
Coroutine
InferenceSession
(
Builder
InferenceSession
(
psiCallResolver
,
postponedArgumentsAnalyzer
,
kotlinConstraintSystemCompleter
,
callComponents
,
builtIns
,
topLevelCallContext
,
stubsForPostponedVariables
,
trace
,
kotlinToResolvedCallTransformer
,
expressionTypingServices
,
argumentTypeResolver
,
...
...
compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt
浏览文件 @
b5d3f9ee
...
...
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny
import
org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import
org.jetbrains.kotlin.resolve.calls.checkers.isBuiltInCoroutineContext
import
org.jetbrains.kotlin.resolve.calls.context.*
import
org.jetbrains.kotlin.resolve.calls.inference.
Coroutine
InferenceSession
import
org.jetbrains.kotlin.resolve.calls.inference.
Builder
InferenceSession
import
org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults
import
org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResultsUtil
import
org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
...
...
@@ -553,7 +553,7 @@ class DoubleColonExpressionResolver(
val
dataFlowInfo
=
(
lhs
as
?
DoubleColonLHS
.
Expression
)
?.
dataFlowInfo
?:
c
.
dataFlowInfo
if
(
c
.
inferenceSession
is
Coroutine
InferenceSession
&&
result
?.
contains
{
it
is
StubType
}
==
true
)
{
if
(
c
.
inferenceSession
is
Builder
InferenceSession
&&
result
?.
contains
{
it
is
StubType
}
==
true
)
{
c
.
inferenceSession
.
addOldCallableReferenceCalls
(
expression
)
}
...
...
compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingServices.java
浏览文件 @
b5d3f9ee
...
...
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.resolve.*;
import
org.jetbrains.kotlin.resolve.calls.components.InferenceSession
;
import
org.jetbrains.kotlin.resolve.calls.context.ContextDependency
;
import
org.jetbrains.kotlin.resolve.calls.context.ResolutionContext
;
import
org.jetbrains.kotlin.resolve.calls.inference.
Coroutine
InferenceSession
;
import
org.jetbrains.kotlin.resolve.calls.inference.
Builder
InferenceSession
;
import
org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
;
import
org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValue
;
import
org.jetbrains.kotlin.resolve.calls.tower.KotlinResolutionCallbacksImpl
;
...
...
@@ -429,7 +429,7 @@ public class ExpressionTypingServices {
@NotNull
KtExpression
statementExpression
,
@NotNull
ExpressionTypingContext
context
)
{
if
(!
context
.
languageVersionSettings
.
supportsFeature
(
LanguageFeature
.
NewInference
)
||
context
.
inferenceSession
instanceof
Coroutine
InferenceSession
)
if
(!
context
.
languageVersionSettings
.
supportsFeature
(
LanguageFeature
.
NewInference
)
||
context
.
inferenceSession
instanceof
Builder
InferenceSession
)
return
null
;
KtFunctionLiteral
functionLiteral
=
PsiUtilsKt
.
getNonStrictParentOfType
(
statementExpression
,
KtFunctionLiteral
.
class
);
if
(
functionLiteral
!=
null
)
{
...
...
compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorForStatements.java
浏览文件 @
b5d3f9ee
...
...
@@ -34,7 +34,7 @@ import org.jetbrains.kotlin.resolve.calls.ArgumentTypeResolver;
import
org.jetbrains.kotlin.resolve.calls.context.CallPosition
;
import
org.jetbrains.kotlin.resolve.calls.context.ContextDependency
;
import
org.jetbrains.kotlin.resolve.calls.context.TemporaryTraceAndCache
;
import
org.jetbrains.kotlin.resolve.calls.inference.
Coroutine
InferenceSession
;
import
org.jetbrains.kotlin.resolve.calls.inference.
Builder
InferenceSession
;
import
org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
;
import
org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults
;
import
org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResultsImpl
;
...
...
@@ -247,8 +247,8 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
if
(
assignmentOperationType
==
null
||
lhsAssignable
)
{
// Check for '+'
// We should clear calls info for coroutine inference within right side as here we analyze it a second time in another context
if
(
context
.
inferenceSession
instanceof
Coroutine
InferenceSession
)
{
((
Coroutine
InferenceSession
)
context
.
inferenceSession
).
clearCallsInfoByContainingElement
(
right
);
if
(
context
.
inferenceSession
instanceof
Builder
InferenceSession
)
{
((
Builder
InferenceSession
)
context
.
inferenceSession
).
clearCallsInfoByContainingElement
(
right
);
}
Name
counterpartName
=
OperatorConventions
.
BINARY_OPERATION_NAMES
.
get
(
OperatorConventions
.
ASSIGNMENT_OPERATION_COUNTERPARTS
.
get
(
operationType
));
binaryOperationDescriptors
=
components
.
callResolver
.
resolveBinaryCall
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录