001 /*
002 * Copyright 2010-2013 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.jet.lang.resolve.calls.context;
018
019 import org.jetbrains.annotations.NotNull;
020 import org.jetbrains.jet.lang.psi.Call;
021 import org.jetbrains.jet.lang.resolve.BindingTrace;
022 import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
023 import org.jetbrains.jet.lang.resolve.scopes.JetScope;
024 import org.jetbrains.jet.lang.types.JetType;
025
026 public abstract class CallResolutionContext<Context extends CallResolutionContext> extends ResolutionContext<Context> {
027 public final Call call;
028 public final ResolveMode resolveMode;
029 public final CheckValueArgumentsMode checkArguments;
030 public final ResolutionResultsCache resolutionResultsCache;
031
032 protected CallResolutionContext(
033 @NotNull BindingTrace trace,
034 @NotNull JetScope scope,
035 @NotNull Call call,
036 @NotNull JetType expectedType,
037 @NotNull DataFlowInfo dataFlowInfo,
038 @NotNull ResolveMode resolveMode,
039 @NotNull CheckValueArgumentsMode checkArguments,
040 @NotNull ExpressionPosition expressionPosition,
041 @NotNull ResolutionResultsCache resolutionResultsCache
042 ) {
043 super(trace, scope, expectedType, dataFlowInfo, expressionPosition);
044 this.call = call;
045 this.resolveMode = resolveMode;
046 this.checkArguments = checkArguments;
047 this.resolutionResultsCache = resolutionResultsCache;
048 }
049
050 public BasicCallResolutionContext toBasic() {
051 return BasicCallResolutionContext.create(this, call, resolveMode, checkArguments, resolutionResultsCache);
052 }
053 }