001 /*
002 * Copyright 2010-2015 JetBrains s.r.o.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017 package org.jetbrains.kotlin.resolve.calls.context;
018
019 import org.jetbrains.annotations.NotNull;
020 import org.jetbrains.kotlin.resolve.BindingTrace;
021 import org.jetbrains.kotlin.resolve.StatementFilter;
022 import org.jetbrains.kotlin.resolve.calls.checkers.AdditionalTypeChecker;
023 import org.jetbrains.kotlin.resolve.calls.checkers.CallChecker;
024 import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo;
025 import org.jetbrains.kotlin.resolve.scopes.JetScope;
026 import org.jetbrains.kotlin.resolve.validation.SymbolUsageValidator;
027 import org.jetbrains.kotlin.types.JetType;
028
029 public class SimpleResolutionContext extends ResolutionContext<SimpleResolutionContext> {
030 private SimpleResolutionContext(
031 @NotNull BindingTrace trace,
032 @NotNull JetScope scope,
033 @NotNull JetType expectedType,
034 @NotNull DataFlowInfo dataFlowInfo,
035 @NotNull ContextDependency contextDependency,
036 @NotNull ResolutionResultsCache resolutionResultsCache,
037 @NotNull CallChecker callChecker,
038 @NotNull SymbolUsageValidator symbolUsageValidator,
039 @NotNull AdditionalTypeChecker additionalTypeChecker,
040 @NotNull StatementFilter statementFilter,
041 boolean isAnnotationContext,
042 boolean collectAllCandidates,
043 boolean insideSafeCallChain
044 ) {
045 super(trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache, callChecker, symbolUsageValidator,
046 additionalTypeChecker,
047 statementFilter, isAnnotationContext, collectAllCandidates, insideSafeCallChain);
048 }
049
050 public SimpleResolutionContext(
051 @NotNull BindingTrace trace,
052 @NotNull JetScope scope,
053 @NotNull JetType expectedType,
054 @NotNull DataFlowInfo dataFlowInfo,
055 @NotNull ContextDependency contextDependency,
056 @NotNull CallChecker callChecker,
057 @NotNull SymbolUsageValidator symbolUsageValidator,
058 @NotNull AdditionalTypeChecker additionalTypeChecker,
059 @NotNull StatementFilter statementFilter
060 ) {
061 this(trace, scope, expectedType, dataFlowInfo, contextDependency, new ResolutionResultsCacheImpl(),
062 callChecker, symbolUsageValidator, additionalTypeChecker, statementFilter, false, false, false);
063 }
064
065 @Override
066 protected SimpleResolutionContext create(
067 @NotNull BindingTrace trace,
068 @NotNull JetScope scope,
069 @NotNull DataFlowInfo dataFlowInfo,
070 @NotNull JetType expectedType,
071 @NotNull ContextDependency contextDependency,
072 @NotNull ResolutionResultsCache resolutionResultsCache,
073 @NotNull StatementFilter statementFilter,
074 boolean collectAllCandidates,
075 boolean insideSafeCallChain
076 ) {
077 return new SimpleResolutionContext(
078 trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache,
079 callChecker, symbolUsageValidator, additionalTypeChecker,
080 statementFilter, isAnnotationContext, collectAllCandidates, insideSafeCallChain);
081 }
082 }