diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt index 695cbae3b53..73151948318 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve @@ -32,6 +21,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getCall import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall import org.jetbrains.kotlin.resolve.calls.checkers.OperatorCallChecker +import org.jetbrains.kotlin.resolve.calls.components.InferenceSession import org.jetbrains.kotlin.resolve.calls.context.ContextDependency import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystem import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemCompleter @@ -575,7 +565,7 @@ class DelegatedPropertyResolver( val contextForProvideDelegate = ExpressionTypingContext.newContext( traceToResolveConventionMethods, scopeForDelegate, delegateTypeInfo.dataFlowInfo, NO_EXPECTED_TYPE, ContextDependency.DEPENDENT, StatementFilter.NONE, - languageVersionSettings, dataFlowValueFactory + languageVersionSettings, dataFlowValueFactory, InferenceSession.default ) val delegateTypeConstructor = delegateTypeInfo.type?.constructor diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java index c2c7d382b5d..b22b1231274 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve.calls; @@ -35,6 +24,7 @@ import org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt; import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt; import org.jetbrains.kotlin.resolve.calls.callResolverUtil.ResolveArgumentsMode; import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt; +import org.jetbrains.kotlin.resolve.calls.components.InferenceSession; import org.jetbrains.kotlin.resolve.calls.context.*; import org.jetbrains.kotlin.resolve.calls.inference.CoroutineInferenceUtilKt; import org.jetbrains.kotlin.resolve.calls.model.KotlinCallKind; @@ -307,7 +297,7 @@ public class CallResolver { return resolveFunctionCall( BasicCallResolutionContext.create( trace, scope, call, expectedType, dataFlowInfo, ContextDependency.INDEPENDENT, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS, - isAnnotationContext, languageVersionSettings, dataFlowValueFactory + isAnnotationContext, languageVersionSettings, dataFlowValueFactory, InferenceSession.Companion.getDefault() ) ); } @@ -435,7 +425,8 @@ public class CallResolver { dataFlowInfo, ContextDependency.INDEPENDENT, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS, false, languageVersionSettings, - dataFlowValueFactory); + dataFlowValueFactory, + InferenceSession.Companion.getDefault()); if (call.getCalleeExpression() == null) return checkArgumentTypesAndFail(context); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/BasicCallResolutionContext.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/BasicCallResolutionContext.java index d876f139dd1..6dd26e44c9f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/BasicCallResolutionContext.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/BasicCallResolutionContext.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve.calls.context; @@ -24,6 +13,7 @@ import org.jetbrains.kotlin.psi.Call; import org.jetbrains.kotlin.psi.KtExpression; import org.jetbrains.kotlin.resolve.BindingTrace; import org.jetbrains.kotlin.resolve.StatementFilter; +import org.jetbrains.kotlin.resolve.calls.components.InferenceSession; import org.jetbrains.kotlin.resolve.calls.model.MutableDataFlowInfoForArguments; import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo; import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory; @@ -48,11 +38,33 @@ public class BasicCallResolutionContext extends CallResolutionContext expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ) { super(trace, scope, call, expectedType, dataFlowInfo, contextDependency, checkArguments, resolutionResultsCache, dataFlowInfoForArguments, statementFilter, isAnnotationContext, isDebuggerContext, collectAllCandidates, - callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory); + callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory, inferenceSession); + } + + @NotNull + public static BasicCallResolutionContext create( + @NotNull BindingTrace trace, + @NotNull LexicalScope scope, + @NotNull Call call, + @NotNull KotlinType expectedType, + @NotNull DataFlowInfo dataFlowInfo, + @NotNull ContextDependency contextDependency, + @NotNull CheckArgumentTypesMode checkArguments, + boolean isAnnotationContext, + @NotNull LanguageVersionSettings languageVersionSettings, + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession + ) { + return new BasicCallResolutionContext(trace, scope, call, expectedType, dataFlowInfo, contextDependency, checkArguments, + new ResolutionResultsCacheImpl(), null, + StatementFilter.NONE, isAnnotationContext, false, false, + CallPosition.Unknown.INSTANCE, DEFAULT_EXPRESSION_CONTEXT_PROVIDER, languageVersionSettings, + dataFlowValueFactory, inferenceSession); } @NotNull @@ -72,7 +84,7 @@ public class BasicCallResolutionContext extends CallResolutionContext expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ) { return new BasicCallResolutionContext( trace, scope, call, expectedType, dataFlowInfo, contextDependency, checkArguments, resolutionResultsCache, dataFlowInfoForArguments, statementFilter, isAnnotationContext, isDebuggerContext, collectAllCandidates, - callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory); + callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory, inferenceSession); } @NotNull @@ -120,6 +134,6 @@ public class BasicCallResolutionContext extends CallResolutionContext @NotNull CallPosition callPosition, @NotNull Function1 expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ) { super(trace, scope, call, expectedType, dataFlowInfo, contextDependency, checkArguments, resolutionResultsCache, dataFlowInfoForArguments, statementFilter, isAnnotationContext, isDebuggerContext, - collectAllCandidates, callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory); + collectAllCandidates, callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory, + inferenceSession); this.candidateCall = candidateCall; this.tracing = tracing; this.candidateResolveMode = candidateResolveMode; @@ -82,7 +74,8 @@ public final class CallCandidateResolutionContext context.resolutionResultsCache, context.dataFlowInfoForArguments, context.statementFilter, candidateResolveMode, context.isAnnotationContext, context.isDebuggerContext, context.collectAllCandidates, - context.callPosition, context.expressionContextProvider, context.languageVersionSettings, context.dataFlowValueFactory); + context.callPosition, context.expressionContextProvider, context.languageVersionSettings, context.dataFlowValueFactory, + context.inferenceSession); } @NotNull @@ -94,7 +87,8 @@ public final class CallCandidateResolutionContext context.dataFlowInfo, context.contextDependency, context.checkArguments, context.resolutionResultsCache, context.dataFlowInfoForArguments, context.statementFilter, CandidateResolveMode.FULLY, context.isAnnotationContext, context.isDebuggerContext, context.collectAllCandidates, - context.callPosition, context.expressionContextProvider, context.languageVersionSettings, context.dataFlowValueFactory); + context.callPosition, context.expressionContextProvider, context.languageVersionSettings, context.dataFlowValueFactory, + context.inferenceSession); } @Override @@ -110,12 +104,13 @@ public final class CallCandidateResolutionContext @NotNull CallPosition callPosition, @NotNull Function1 expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ) { return new CallCandidateResolutionContext<>( candidateCall, tracing, trace, scope, call, expectedType, dataFlowInfo, contextDependency, checkArguments, resolutionResultsCache, dataFlowInfoForArguments, statementFilter, candidateResolveMode, isAnnotationContext, isDebuggerContext, collectAllCandidates, callPosition, expressionContextProvider, - languageVersionSettings, dataFlowValueFactory); + languageVersionSettings, dataFlowValueFactory, inferenceSession); } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/CallResolutionContext.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/CallResolutionContext.java index 73c98747ce6..8ee014c36c7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/CallResolutionContext.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/CallResolutionContext.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve.calls.context; @@ -24,6 +13,7 @@ import org.jetbrains.kotlin.psi.Call; import org.jetbrains.kotlin.psi.KtExpression; import org.jetbrains.kotlin.resolve.BindingTrace; import org.jetbrains.kotlin.resolve.StatementFilter; +import org.jetbrains.kotlin.resolve.calls.components.InferenceSession; import org.jetbrains.kotlin.resolve.calls.model.DataFlowInfoForArgumentsImpl; import org.jetbrains.kotlin.resolve.calls.model.MutableDataFlowInfoForArguments; import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo; @@ -57,11 +47,12 @@ public abstract class CallResolutionContext expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ) { super(trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache, statementFilter, isAnnotationContext, isDebuggerContext, collectAllCandidates, callPosition, expressionContextProvider, languageVersionSettings, - dataFlowValueFactory); + dataFlowValueFactory, inferenceSession); this.call = call; this.checkArguments = checkArguments; if (dataFlowInfoForArguments != null) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/ResolutionContext.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/ResolutionContext.java index e15d10aace3..9410949d586 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/ResolutionContext.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/context/ResolutionContext.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve.calls.context; @@ -25,6 +14,7 @@ import org.jetbrains.kotlin.config.LanguageVersionSettings; import org.jetbrains.kotlin.psi.KtExpression; import org.jetbrains.kotlin.resolve.BindingTrace; import org.jetbrains.kotlin.resolve.StatementFilter; +import org.jetbrains.kotlin.resolve.calls.components.InferenceSession; import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo; import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory; import org.jetbrains.kotlin.resolve.scopes.LexicalScope; @@ -68,6 +58,9 @@ public abstract class ResolutionContext expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory factory + @NotNull DataFlowValueFactory factory, + @NotNull InferenceSession inferenceSession ) { this.trace = trace; this.scope = scope; @@ -110,6 +104,7 @@ public abstract class ResolutionContext expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ); @NotNull @@ -137,14 +133,16 @@ public abstract class ResolutionContext expressionContextProvider) { return create(trace, scope, dataFlowInfo, expectedType, contextDependency, resolutionResultsCache, statementFilter, - collectAllCandidates, callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory); + collectAllCandidates, callPosition, expressionContextProvider, languageVersionSettings, dataFlowValueFactory, + inferenceSession); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt index 8dd46acd1ef..bb32d0467f2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/KotlinResolutionCallbacksImpl.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve.calls.tower @@ -193,6 +182,8 @@ class KotlinResolutionCallbacksImpl( return constantExpressionEvaluator.evaluateExpression(expression, temporaryBindingTrace, expectedType) != null } + override val inferenceSession = topLevelCallContext.inferenceSession + private fun findCommonParent(callElement: KtExpression, receiver: ReceiverKotlinCallArgument?): KtExpression { if (receiver == null) return callElement return PsiTreeUtil.findCommonParent(callElement, receiver.psiExpression)?.safeAs() ?: callElement diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java index dd6ca3eb37c..58ffb096836 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.types.expressions; diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingContext.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingContext.java index feabfb30ffa..09eac58ca1a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingContext.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingContext.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.types.expressions; @@ -22,6 +11,7 @@ import org.jetbrains.kotlin.config.LanguageVersionSettings; import org.jetbrains.kotlin.psi.KtExpression; import org.jetbrains.kotlin.resolve.BindingTrace; import org.jetbrains.kotlin.resolve.StatementFilter; +import org.jetbrains.kotlin.resolve.calls.components.InferenceSession; import org.jetbrains.kotlin.resolve.calls.context.*; import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo; import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory; @@ -39,7 +29,22 @@ public class ExpressionTypingContext extends ResolutionContext expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ) { super(trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache, statementFilter, isAnnotationContext, isDebuggerContext, collectAllCandidates, callPosition, expressionContextProvider, - languageVersionSettings, dataFlowValueFactory); + languageVersionSettings, dataFlowValueFactory, inferenceSession); } @Override @@ -133,12 +158,13 @@ public class ExpressionTypingContext extends ResolutionContext expressionContextProvider, @NotNull LanguageVersionSettings languageVersionSettings, - @NotNull DataFlowValueFactory dataFlowValueFactory + @NotNull DataFlowValueFactory dataFlowValueFactory, + @NotNull InferenceSession inferenceSession ) { return new ExpressionTypingContext(trace, scope, dataFlowInfo, expectedType, contextDependency, resolutionResultsCache, statementFilter, isAnnotationContext, isDebuggerContext, collectAllCandidates, callPosition, expressionContextProvider, - languageVersionSettings, dataFlowValueFactory); + languageVersionSettings, dataFlowValueFactory, inferenceSession); } } diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt index 2162c72632b..8b7b642bd49 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/ExternalComponents.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve.calls.components @@ -50,4 +39,6 @@ interface KotlinResolutionCallbacks { fun createReceiverWithSmartCastInfo(resolvedAtom: ResolvedCallAtom): ReceiverValueWithSmartCastInfo? fun isCompileTimeConstant(resolvedAtom: ResolvedCallAtom, expectedType: UnwrappedType): Boolean + + val inferenceSession: InferenceSession } \ No newline at end of file diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt index 4eec28ba9b4..1a46c05cd63 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt @@ -163,4 +163,10 @@ class KotlinCallCompleter( systemStorage ) } +} + +interface InferenceSession { + companion object { + val default = object : InferenceSession {} + } } \ No newline at end of file