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.types.JetType; 027 028 public class SimpleResolutionContext extends ResolutionContext<SimpleResolutionContext> { 029 private SimpleResolutionContext( 030 @NotNull BindingTrace trace, 031 @NotNull JetScope scope, 032 @NotNull JetType expectedType, 033 @NotNull DataFlowInfo dataFlowInfo, 034 @NotNull ContextDependency contextDependency, 035 @NotNull ResolutionResultsCache resolutionResultsCache, 036 @NotNull CallChecker callChecker, 037 @NotNull AdditionalTypeChecker additionalTypeChecker, 038 @NotNull StatementFilter statementFilter, 039 boolean isAnnotationContext, 040 boolean collectAllCandidates 041 ) { 042 super(trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache, callChecker, additionalTypeChecker, 043 statementFilter, isAnnotationContext, collectAllCandidates); 044 } 045 046 public SimpleResolutionContext( 047 @NotNull BindingTrace trace, 048 @NotNull JetScope scope, 049 @NotNull JetType expectedType, 050 @NotNull DataFlowInfo dataFlowInfo, 051 @NotNull ContextDependency contextDependency, 052 @NotNull CallChecker callChecker, 053 @NotNull AdditionalTypeChecker additionalTypeChecker, 054 @NotNull StatementFilter statementFilter 055 ) { 056 this(trace, scope, expectedType, dataFlowInfo, contextDependency, new ResolutionResultsCacheImpl(), 057 callChecker, additionalTypeChecker, statementFilter, false, false); 058 } 059 060 @Override 061 protected SimpleResolutionContext create( 062 @NotNull BindingTrace trace, 063 @NotNull JetScope scope, 064 @NotNull DataFlowInfo dataFlowInfo, 065 @NotNull JetType expectedType, 066 @NotNull ContextDependency contextDependency, 067 @NotNull ResolutionResultsCache resolutionResultsCache, 068 @NotNull StatementFilter statementFilter, 069 boolean collectAllCandidates 070 ) { 071 return new SimpleResolutionContext( 072 trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache, callChecker, additionalTypeChecker, 073 statementFilter, isAnnotationContext, collectAllCandidates); 074 } 075 }