Rename getOutType() -> getType()
This commit is contained in:
@@ -119,7 +119,7 @@ public abstract class ClassBodyCodegen {
|
||||
if(state.getStandardLibrary().isVolatile(propertyDescriptor)) {
|
||||
modifiers |= Opcodes.ACC_VOLATILE;
|
||||
}
|
||||
v.newField(p, modifiers, p.getName(), state.getTypeMapper().mapType(propertyDescriptor.getOutType()).getDescriptor(), null, null);
|
||||
v.newField(p, modifiers, p.getName(), state.getTypeMapper().mapType(propertyDescriptor.getType()).getDescriptor(), null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ClosureCodegen extends ObjectOrClosureCodegen {
|
||||
final String funClass = getInternalClassName(funDescriptor);
|
||||
signatureWriter.visitClassType(funClass);
|
||||
for (ValueParameterDescriptor parameter : parameters) {
|
||||
appendType(signatureWriter, parameter.getOutType(), '=');
|
||||
appendType(signatureWriter, parameter.getType(), '=');
|
||||
}
|
||||
|
||||
appendType(signatureWriter, funDescriptor.getReturnType(), '=');
|
||||
@@ -233,7 +233,7 @@ public class ClosureCodegen extends ObjectOrClosureCodegen {
|
||||
final List<ValueParameterDescriptor> params = funDescriptor.getValueParameters();
|
||||
for (ValueParameterDescriptor param : params) {
|
||||
StackValue.local(count, JetTypeMapper.TYPE_OBJECT).put(JetTypeMapper.TYPE_OBJECT, iv);
|
||||
StackValue.onStack(JetTypeMapper.TYPE_OBJECT).upcast(state.getTypeMapper().mapType(param.getOutType()), iv);
|
||||
StackValue.onStack(JetTypeMapper.TYPE_OBJECT).upcast(state.getTypeMapper().mapType(param.getType()), iv);
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ public class ClosureCodegen extends ObjectOrClosureCodegen {
|
||||
for (DeclarationDescriptor descriptor : closure.keySet()) {
|
||||
if(descriptor instanceof VariableDescriptor && !(descriptor instanceof PropertyDescriptor)) {
|
||||
final Type sharedVarType = exprContext.getTypeMapper().getSharedVarType(descriptor);
|
||||
final Type type = sharedVarType != null ? sharedVarType : state.getTypeMapper().mapType(((VariableDescriptor) descriptor).getOutType());
|
||||
final Type type = sharedVarType != null ? sharedVarType : state.getTypeMapper().mapType(((VariableDescriptor) descriptor).getType());
|
||||
argTypes[i++] = type;
|
||||
}
|
||||
else if(CodegenUtil.isNamedFun(descriptor, state.getBindingContext()) && descriptor.getContainingDeclaration() instanceof FunctionDescriptor) {
|
||||
|
||||
@@ -257,13 +257,13 @@ public abstract class CodegenContext {
|
||||
CallableMemberDescriptor.Kind.DECLARATION
|
||||
);
|
||||
JetType receiverType = pd.getReceiverParameter().exists() ? pd.getReceiverParameter().getType() : null;
|
||||
myAccessor.setType(pd.getOutType(), Collections.<TypeParameterDescriptor>emptyList(), pd.getExpectedThisObject(), receiverType);
|
||||
myAccessor.setType(pd.getType(), Collections.<TypeParameterDescriptor>emptyList(), pd.getExpectedThisObject(), receiverType);
|
||||
|
||||
PropertyGetterDescriptor pgd = new PropertyGetterDescriptor(
|
||||
myAccessor, Collections.<AnnotationDescriptor>emptyList(), myAccessor.getModality(),
|
||||
myAccessor.getVisibility(),
|
||||
false, false, CallableMemberDescriptor.Kind.DECLARATION);
|
||||
pgd.initialize(myAccessor.getOutType());
|
||||
pgd.initialize(myAccessor.getType());
|
||||
|
||||
PropertySetterDescriptor psd = new PropertySetterDescriptor(
|
||||
myAccessor, Collections.<AnnotationDescriptor>emptyList(), myAccessor.getModality(),
|
||||
|
||||
@@ -353,7 +353,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
JetType iteratorType = iteratorDescriptor.getReturnType();
|
||||
Type asmIterType = boxType(asmType(iteratorType));
|
||||
|
||||
JetType paramType = parameterDescriptor.getOutType();
|
||||
JetType paramType = parameterDescriptor.getType();
|
||||
Type asmParamType = asmType(paramType);
|
||||
|
||||
int iteratorVar = myFrameMap.enterTemp();
|
||||
@@ -428,7 +428,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
}
|
||||
|
||||
public void invoke() {
|
||||
JetType paramType = parameterDescriptor.getOutType();
|
||||
JetType paramType = parameterDescriptor.getType();
|
||||
Type asmParamType = asmType(paramType);
|
||||
|
||||
myFrameMap.enter(parameterDescriptor, asmParamType.getSize());
|
||||
@@ -801,7 +801,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
if(entry.getKey() instanceof VariableDescriptor && !(entry.getKey() instanceof PropertyDescriptor)) {
|
||||
Type sharedVarType = typeMapper.getSharedVarType(entry.getKey());
|
||||
if(sharedVarType == null)
|
||||
sharedVarType = state.getTypeMapper().mapType(((VariableDescriptor) entry.getKey()).getOutType());
|
||||
sharedVarType = state.getTypeMapper().mapType(((VariableDescriptor) entry.getKey()).getType());
|
||||
consArgTypes.add(sharedVarType);
|
||||
entry.getValue().getOuterValue().put(sharedVarType, v);
|
||||
}
|
||||
@@ -833,7 +833,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
assert variableDescriptor != null;
|
||||
|
||||
final Type sharedVarType = typeMapper.getSharedVarType(variableDescriptor);
|
||||
final Type type = sharedVarType != null ? sharedVarType : asmType(variableDescriptor.getOutType());
|
||||
final Type type = sharedVarType != null ? sharedVarType : asmType(variableDescriptor.getType());
|
||||
myFrameMap.enter(variableDescriptor, type.getSize());
|
||||
}
|
||||
|
||||
@@ -874,7 +874,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
int index = myFrameMap.leave(variableDescriptor);
|
||||
|
||||
final Type sharedVarType = typeMapper.getSharedVarType(variableDescriptor);
|
||||
final Type type = sharedVarType != null ? sharedVarType : asmType(variableDescriptor.getOutType());
|
||||
final Type type = sharedVarType != null ? sharedVarType : asmType(variableDescriptor.getType());
|
||||
if(sharedVarType != null) {
|
||||
v.aconst(null);
|
||||
v.store(index, TYPE_OBJECT);
|
||||
@@ -983,7 +983,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
if (index >= 0) {
|
||||
if(descriptor instanceof VariableDescriptor) {
|
||||
Type sharedVarType = typeMapper.getSharedVarType(descriptor);
|
||||
final JetType outType = ((VariableDescriptor) descriptor).getOutType();
|
||||
final JetType outType = ((VariableDescriptor) descriptor).getType();
|
||||
if(sharedVarType != null) {
|
||||
return StackValue.shared(index, asmType(outType));
|
||||
}
|
||||
@@ -1231,7 +1231,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
ownerParam = callableMethod.getDefaultImplParam();
|
||||
}
|
||||
|
||||
return StackValue.property(propertyDescriptor.getName(), owner, ownerParam, asmType(propertyDescriptor.getOutType()), isStatic, isInterface, isSuper, getter, setter, invokeOpcode);
|
||||
return StackValue.property(propertyDescriptor.getName(), owner, ownerParam, asmType(propertyDescriptor.getType()), isStatic, isInterface, isSuper, getter, setter, invokeOpcode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1511,7 +1511,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
}
|
||||
else if(resolvedValueArgument instanceof VarargValueArgument) {
|
||||
VarargValueArgument valueArgument = (VarargValueArgument) resolvedValueArgument;
|
||||
JetType outType = valueParameterDescriptor.getOutType();
|
||||
JetType outType = valueParameterDescriptor.getType();
|
||||
|
||||
Type type = asmType(outType);
|
||||
assert type.getSort() == Type.ARRAY;
|
||||
@@ -1682,7 +1682,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
StackValue leftValue = gen(expr);
|
||||
FunctionDescriptor op = (FunctionDescriptor) bindingContext.get(BindingContext.REFERENCE_TARGET, expression.getOperationReference());
|
||||
assert op != null;
|
||||
leftValue.put(asmType(op.getValueParameters().get(0).getOutType()), v);
|
||||
leftValue.put(asmType(op.getValueParameters().get(0).getType()), v);
|
||||
genToJVMStack(expression.getRight());
|
||||
v.swap();
|
||||
invokeFunctionNoParams(op, Type.BOOLEAN_TYPE, v);
|
||||
@@ -2209,7 +2209,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
|
||||
final Type sharedVarType = typeMapper.getSharedVarType(variableDescriptor);
|
||||
assert variableDescriptor != null;
|
||||
Type varType = asmType(variableDescriptor.getOutType());
|
||||
Type varType = asmType(variableDescriptor.getType());
|
||||
if(sharedVarType != null) {
|
||||
v.anew(sharedVarType);
|
||||
v.dup();
|
||||
@@ -2371,7 +2371,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
final List<JetExpression> indices = expression.getIndexExpressions();
|
||||
FunctionDescriptor operationDescriptor = (FunctionDescriptor) bindingContext.get(BindingContext.REFERENCE_TARGET, expression);
|
||||
assert operationDescriptor != null;
|
||||
if (arrayType.getSort() == Type.ARRAY && indices.size() == 1 && operationDescriptor.getValueParameters().get(0).getOutType().equals(state.getStandardLibrary().getIntType())) {
|
||||
if (arrayType.getSort() == Type.ARRAY && indices.size() == 1 && operationDescriptor.getValueParameters().get(0).getType().equals(state.getStandardLibrary().getIntType())) {
|
||||
gen(array, arrayType);
|
||||
for (JetExpression index : indices) {
|
||||
gen(index, Type.INT_TYPE);
|
||||
@@ -2499,7 +2499,7 @@ If finally block is present, its last expression is the value of try expression.
|
||||
|
||||
VariableDescriptor descriptor = bindingContext.get(BindingContext.VALUE_PARAMETER, clause.getCatchParameter());
|
||||
assert descriptor != null;
|
||||
Type descriptorType = asmType(descriptor.getOutType());
|
||||
Type descriptorType = asmType(descriptor.getType());
|
||||
myFrameMap.enter(descriptor, 1);
|
||||
int index = lookupLocal(descriptor);
|
||||
v.store(index, descriptorType);
|
||||
@@ -2614,7 +2614,7 @@ If finally block is present, its last expression is the value of try expression.
|
||||
final JetProperty var = ((JetBindingPattern) pattern).getVariableDeclaration();
|
||||
final VariableDescriptor variableDescriptor = bindingContext.get(BindingContext.VARIABLE, var);
|
||||
assert variableDescriptor != null;
|
||||
final Type varType = asmType(variableDescriptor.getOutType());
|
||||
final Type varType = asmType(variableDescriptor.getType());
|
||||
myFrameMap.enter(variableDescriptor, varType.getSize());
|
||||
expressionToMatch.dupReceiver(v);
|
||||
expressionToMatch.put(varType, v);
|
||||
|
||||
@@ -153,7 +153,7 @@ public class FunctionCodegen {
|
||||
if(parameterDescriptor.hasDefaultValue()) {
|
||||
av.visit(JvmStdlibNames.JET_VALUE_PARAMETER_HAS_DEFAULT_VALUE_FIELD, true);
|
||||
}
|
||||
if(parameterDescriptor.getOutType().isNullable()) {
|
||||
if(parameterDescriptor.getType().isNullable()) {
|
||||
av.visit(JvmStdlibNames.JET_VALUE_PARAMETER_NULLABLE_FIELD, true);
|
||||
}
|
||||
if (jvmSignature.getKotlinParameterTypes() != null && jvmSignature.getKotlinParameterTypes().get(i) != null) {
|
||||
@@ -205,7 +205,7 @@ public class FunctionCodegen {
|
||||
for (ValueParameterDescriptor parameter : paramDescrs) {
|
||||
Type sharedVarType = typeMapper.getSharedVarType(parameter);
|
||||
if (sharedVarType != null) {
|
||||
Type localVarType = typeMapper.mapType(parameter.getOutType());
|
||||
Type localVarType = typeMapper.mapType(parameter.getType());
|
||||
int index = frameMap.getIndex(parameter);
|
||||
mv.visitTypeInsn(NEW, sharedVarType.getInternalName());
|
||||
mv.visitInsn(DUP);
|
||||
@@ -239,7 +239,7 @@ public class FunctionCodegen {
|
||||
}
|
||||
|
||||
for (ValueParameterDescriptor parameter : paramDescrs) {
|
||||
Type type = typeMapper.mapType(parameter.getOutType());
|
||||
Type type = typeMapper.mapType(parameter.getType());
|
||||
// TODO: specify signature
|
||||
mv.visitLocalVariable(parameter.getName(), type.getDescriptor(), null, methodBegin, methodEnd, k);
|
||||
k += type.getSize();
|
||||
|
||||
@@ -451,7 +451,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
for (DeclarationDescriptor descriptor : closure.closure.keySet()) {
|
||||
if(descriptor instanceof VariableDescriptor && !(descriptor instanceof PropertyDescriptor)) {
|
||||
final Type sharedVarType = typeMapper.getSharedVarType(descriptor);
|
||||
final Type type = sharedVarType != null ? sharedVarType : state.getTypeMapper().mapType(((VariableDescriptor) descriptor).getOutType());
|
||||
final Type type = sharedVarType != null ? sharedVarType : state.getTypeMapper().mapType(((VariableDescriptor) descriptor).getType());
|
||||
consArgTypes.add(insert++, new JvmMethodParameterSignature(type, "", JvmMethodParameterKind.SHARED_VAR));
|
||||
}
|
||||
else if(descriptor instanceof FunctionDescriptor) {
|
||||
@@ -612,7 +612,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
if(varDescr instanceof VariableDescriptor && !(varDescr instanceof PropertyDescriptor)) {
|
||||
Type sharedVarType = typeMapper.getSharedVarType(varDescr);
|
||||
if(sharedVarType == null) {
|
||||
sharedVarType = typeMapper.mapType(((VariableDescriptor) varDescr).getOutType());
|
||||
sharedVarType = typeMapper.mapType(((VariableDescriptor) varDescr).getType());
|
||||
}
|
||||
iv.load(0, JetTypeMapper.TYPE_OBJECT);
|
||||
iv.load(k, StackValue.refType(sharedVarType));
|
||||
@@ -628,7 +628,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
for (JetParameter parameter : constructorParameters) {
|
||||
if (parameter.getValOrVarNode() != null) {
|
||||
VariableDescriptor descriptor = paramDescrs.get(curParam);
|
||||
Type type = typeMapper.mapType(descriptor.getOutType());
|
||||
Type type = typeMapper.mapType(descriptor.getType());
|
||||
iv.load(0, classType);
|
||||
iv.load(frameMap.getIndex(descriptor), type);
|
||||
iv.putfield(classname, descriptor.getName(), type.getDescriptor());
|
||||
@@ -864,9 +864,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
if(compileTimeValue != null) {
|
||||
assert compileTimeValue != null;
|
||||
Object value = compileTimeValue.getValue();
|
||||
Type type = typeMapper.mapType(propertyDescriptor.getOutType());
|
||||
Type type = typeMapper.mapType(propertyDescriptor.getType());
|
||||
if(JetTypeMapper.isPrimitive(type)) {
|
||||
if( !propertyDescriptor.getOutType().isNullable() && value instanceof Number) {
|
||||
if( !propertyDescriptor.getType().isNullable() && value instanceof Number) {
|
||||
if(type == Type.INT_TYPE && ((Number)value).intValue() == 0)
|
||||
continue;
|
||||
if(type == Type.BYTE_TYPE && ((Number)value).byteValue() == 0)
|
||||
@@ -892,12 +892,12 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
iv.load(0, JetTypeMapper.TYPE_OBJECT);
|
||||
Type type = codegen.expressionType(initializer);
|
||||
if(propertyDescriptor.getOutType().isNullable())
|
||||
if(propertyDescriptor.getType().isNullable())
|
||||
type = JetTypeMapper.boxType(type);
|
||||
codegen.gen(initializer, type);
|
||||
// @todo write directly to the field. Fix test excloset.jet::test6
|
||||
String owner = typeMapper.getOwner(propertyDescriptor, OwnerKind.IMPLEMENTATION);
|
||||
StackValue.property(propertyDescriptor.getName(), owner, owner, typeMapper.mapType(propertyDescriptor.getOutType()), false, false, false, null, null, 0).store(iv);
|
||||
StackValue.property(propertyDescriptor.getName(), owner, owner, typeMapper.mapType(propertyDescriptor.getType()), false, false, false, null, null, 0).store(iv);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ public class JetTypeMapper {
|
||||
|
||||
for (ValueParameterDescriptor parameter : parameters) {
|
||||
signatureVisitor.writeParameterType(JvmMethodParameterKind.VALUE);
|
||||
mapType(parameter.getOutType(), signatureVisitor);
|
||||
mapType(parameter.getType(), signatureVisitor);
|
||||
signatureVisitor.writeParameterTypeEnd();
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ public class JetTypeMapper {
|
||||
}
|
||||
for (ValueParameterDescriptor parameter : parameters) {
|
||||
signatureWriter.writeParameterType(JvmMethodParameterKind.VALUE);
|
||||
mapType(parameter.getOutType(), signatureWriter);
|
||||
mapType(parameter.getType(), signatureWriter);
|
||||
signatureWriter.writeParameterTypeEnd();
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ public class JetTypeMapper {
|
||||
signatureWriter.writeParametersEnd();
|
||||
|
||||
signatureWriter.writeReturnType();
|
||||
mapType(descriptor.getOutType(), signatureWriter);
|
||||
mapType(descriptor.getType(), signatureWriter);
|
||||
signatureWriter.writeReturnTypeEnd();
|
||||
|
||||
JvmMethodSignature jvmMethodSignature = signatureWriter.makeJvmMethodSignature(name);
|
||||
@@ -636,7 +636,7 @@ public class JetTypeMapper {
|
||||
|
||||
writeFormalTypeParameters(descriptor.getTypeParameters(), signatureWriter);
|
||||
|
||||
JetType outType = descriptor.getOutType();
|
||||
JetType outType = descriptor.getType();
|
||||
|
||||
signatureWriter.writeParametersStart();
|
||||
|
||||
@@ -687,7 +687,7 @@ public class JetTypeMapper {
|
||||
|
||||
for (ValueParameterDescriptor parameter : parameters) {
|
||||
signatureWriter.writeParameterType(JvmMethodParameterKind.VALUE);
|
||||
mapType(parameter.getOutType(), signatureWriter);
|
||||
mapType(parameter.getType(), signatureWriter);
|
||||
signatureWriter.writeParameterTypeEnd();
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ public class JetTypeMapper {
|
||||
else if (descriptor instanceof VariableDescriptor) {
|
||||
Boolean aBoolean = bindingContext.get(BindingContext.MUST_BE_WRAPPED_IN_A_REF, (VariableDescriptor) descriptor);
|
||||
if (aBoolean != null && aBoolean) {
|
||||
JetType outType = ((VariableDescriptor) descriptor).getOutType();
|
||||
JetType outType = ((VariableDescriptor) descriptor).getType();
|
||||
return StackValue.sharedTypeForType(mapType(outType));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ObjectOrClosureCodegen {
|
||||
if (idx < 0) return null;
|
||||
|
||||
final Type sharedVarType = state.getTypeMapper().getSharedVarType(vd);
|
||||
Type localType = state.getTypeMapper().mapType(vd.getOutType());
|
||||
Type localType = state.getTypeMapper().mapType(vd.getType());
|
||||
final Type type = sharedVarType != null ? sharedVarType : localType;
|
||||
|
||||
StackValue outerValue = StackValue.local(idx, type);
|
||||
|
||||
@@ -30,10 +30,6 @@ import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.objectweb.asm.Type;
|
||||
import org.objectweb.asm.commons.InstructionAdapter;
|
||||
import org.objectweb.asm.commons.Method;
|
||||
|
||||
import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
|
||||
import static org.objectweb.asm.Opcodes.ACC_SYNTHETIC;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
@@ -99,7 +95,7 @@ public class PropertyCodegen {
|
||||
if(state.getStandardLibrary().isVolatile(propertyDescriptor)) {
|
||||
modifiers |= Opcodes.ACC_VOLATILE;
|
||||
}
|
||||
FieldVisitor fieldVisitor = v.newField(p, modifiers, p.getName(), state.getTypeMapper().mapType(propertyDescriptor.getOutType()).getDescriptor(), null, value);
|
||||
FieldVisitor fieldVisitor = v.newField(p, modifiers, p.getName(), state.getTypeMapper().mapType(propertyDescriptor.getType()).getDescriptor(), null, value);
|
||||
AnnotationCodegen.forField(fieldVisitor).genAnnotations(propertyDescriptor, state.getTypeMapper());
|
||||
}
|
||||
}
|
||||
@@ -179,7 +175,7 @@ public class PropertyCodegen {
|
||||
if (kind != OwnerKind.NAMESPACE) {
|
||||
iv.load(0, JetTypeMapper.TYPE_OBJECT);
|
||||
}
|
||||
final Type type = state.getTypeMapper().mapType(propertyDescriptor.getOutType());
|
||||
final Type type = state.getTypeMapper().mapType(propertyDescriptor.getType());
|
||||
if (kind instanceof OwnerKind.DelegateKind) {
|
||||
OwnerKind.DelegateKind dk = (OwnerKind.DelegateKind) kind;
|
||||
dk.getDelegate().put(JetTypeMapper.TYPE_OBJECT, iv);
|
||||
@@ -240,7 +236,7 @@ public class PropertyCodegen {
|
||||
if (v.generateCode() && (!isTrait || kind instanceof OwnerKind.DelegateKind)) {
|
||||
mv.visitCode();
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
final Type type = state.getTypeMapper().mapType(propertyDescriptor.getOutType());
|
||||
final Type type = state.getTypeMapper().mapType(propertyDescriptor.getType());
|
||||
int paramCode = 0;
|
||||
if (kind != OwnerKind.NAMESPACE) {
|
||||
iv.load(0, JetTypeMapper.TYPE_OBJECT);
|
||||
|
||||
@@ -593,7 +593,7 @@ public abstract class StackValue {
|
||||
List<ValueParameterDescriptor> valueParameters = resolvedGetCall.getResultingDescriptor().getValueParameters();
|
||||
int firstParamIndex = -1;
|
||||
for(int i = valueParameters.size()-1; i >= 0; --i) {
|
||||
Type type = codegen.typeMapper.mapType(valueParameters.get(i).getOutType());
|
||||
Type type = codegen.typeMapper.mapType(valueParameters.get(i).getType());
|
||||
int sz = type.getSize();
|
||||
frame.enterTemp(sz);
|
||||
lastIndex += sz;
|
||||
@@ -673,7 +673,7 @@ public abstract class StackValue {
|
||||
|
||||
int index = firstParamIndex;
|
||||
for(int i = 0; i != valueParameters.size(); ++i) {
|
||||
Type type = codegen.typeMapper.mapType(valueParameters.get(i).getOutType());
|
||||
Type type = codegen.typeMapper.mapType(valueParameters.get(i).getType());
|
||||
int sz = type.getSize();
|
||||
v.load(index-sz, type);
|
||||
index -= sz;
|
||||
@@ -701,7 +701,7 @@ public abstract class StackValue {
|
||||
|
||||
index = firstParamIndex;
|
||||
for(int i = 0; i != valueParameters.size(); ++i) {
|
||||
Type type = codegen.typeMapper.mapType(valueParameters.get(i).getOutType());
|
||||
Type type = codegen.typeMapper.mapType(valueParameters.get(i).getType());
|
||||
int sz = type.getSize();
|
||||
v.load(index-sz, type);
|
||||
index -= sz;
|
||||
@@ -725,7 +725,7 @@ public abstract class StackValue {
|
||||
return false;
|
||||
|
||||
for (ValueParameterDescriptor valueParameter : valueParameters) {
|
||||
if (codegen.typeMapper.mapType(valueParameter.getOutType()).getSize() != 1)
|
||||
if (codegen.typeMapper.mapType(valueParameter.getType()).getSize() != 1)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1240,7 +1240,7 @@ public class JavaDescriptorResolver {
|
||||
getterDescriptor.initialize(propertyType);
|
||||
}
|
||||
if (setterDescriptor != null) {
|
||||
setterDescriptor.initialize(new ValueParameterDescriptorImpl(setterDescriptor, 0, Collections.<AnnotationDescriptor>emptyList(), "p0"/*TODO*/, false, propertyDescriptor.getOutType(), false, null));
|
||||
setterDescriptor.initialize(new ValueParameterDescriptorImpl(setterDescriptor, 0, Collections.<AnnotationDescriptor>emptyList(), "p0"/*TODO*/, false, propertyDescriptor.getType(), false, null));
|
||||
}
|
||||
|
||||
semanticServices.getTrace().record(BindingContext.VARIABLE, anyMember.getMember().psiMember, propertyDescriptor);
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class FunctionDescriptorUtil {
|
||||
for (int i = 0, unsubstitutedValueParametersSize = unsubstitutedValueParameters.size(); i < unsubstitutedValueParametersSize; i++) {
|
||||
ValueParameterDescriptor unsubstitutedValueParameter = unsubstitutedValueParameters.get(i);
|
||||
// TODO : Lazy?
|
||||
JetType substitutedType = substitutor.substitute(unsubstitutedValueParameter.getOutType(), Variance.IN_VARIANCE);
|
||||
JetType substitutedType = substitutor.substitute(unsubstitutedValueParameter.getType(), Variance.IN_VARIANCE);
|
||||
JetType varargElementType = unsubstitutedValueParameter.getVarargElementType();
|
||||
JetType substituteVarargElementType = varargElementType == null ? null : substitutor.substitute(varargElementType, Variance.IN_VARIANCE);
|
||||
if (substitutedType == null) return null;
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.TransientReceiver;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -151,7 +150,7 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
|
||||
@Override
|
||||
public JetType getReturnType() {
|
||||
return getOutType();
|
||||
return getType();
|
||||
}
|
||||
|
||||
public boolean isVar() {
|
||||
@@ -213,7 +212,7 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
List<TypeParameterDescriptor> substitutedTypeParameters = Lists.newArrayList();
|
||||
TypeSubstitutor substitutor = DescriptorSubstitutor.substituteTypeParameters(getTypeParameters(), originalSubstitutor, substitutedDescriptor, substitutedTypeParameters);
|
||||
|
||||
JetType originalOutType = getOutType();
|
||||
JetType originalOutType = getType();
|
||||
JetType outType = substitutor.substitute(originalOutType, Variance.OUT_VARIANCE);
|
||||
if (outType == null) {
|
||||
return null; // TODO : tell the user that the property was projected out
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public class PropertyGetterDescriptor extends PropertyAccessorDescriptor {
|
||||
}
|
||||
|
||||
public void initialize(JetType returnType) {
|
||||
this.returnType = returnType == null ? getCorrespondingProperty().getOutType() : returnType;
|
||||
this.returnType = returnType == null ? getCorrespondingProperty().getType() : returnType;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public interface ValueParameterDescriptor extends VariableDescriptor, Annotated
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
JetType getOutType();
|
||||
JetType getType();
|
||||
|
||||
@Override
|
||||
ValueParameterDescriptor getOriginal();
|
||||
|
||||
+1
-1
@@ -123,6 +123,6 @@ public class ValueParameterDescriptorImpl extends VariableDescriptorImpl impleme
|
||||
@NotNull
|
||||
@Override
|
||||
public ValueParameterDescriptor copy(@NotNull DeclarationDescriptor newOwner) {
|
||||
return new ValueParameterDescriptorImpl(newOwner, index, Lists.newArrayList(getAnnotations()), getName(), isVar, getOutType(), hasDefaultValue, varargElementType);
|
||||
return new ValueParameterDescriptorImpl(newOwner, index, Lists.newArrayList(getAnnotations()), getName(), isVar, getType(), hasDefaultValue, varargElementType);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ import java.util.Collections;
|
||||
*/
|
||||
public class VariableAsFunctionDescriptor extends FunctionDescriptorImpl {
|
||||
public static VariableAsFunctionDescriptor create(@NotNull VariableDescriptor variableDescriptor) {
|
||||
JetType outType = variableDescriptor.getOutType();
|
||||
JetType outType = variableDescriptor.getType();
|
||||
assert outType != null;
|
||||
VariableAsFunctionDescriptor result = new VariableAsFunctionDescriptor(variableDescriptor);
|
||||
FunctionDescriptorUtil.initializeFromFunctionType(result, outType, variableDescriptor.getExpectedThisObject());
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
*/
|
||||
public interface VariableDescriptor extends CallableDescriptor {
|
||||
@NotNull
|
||||
JetType getOutType();
|
||||
JetType getType();
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"NullableProblems"})
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorImpl i
|
||||
}
|
||||
|
||||
@Override
|
||||
public JetType getOutType() {
|
||||
public JetType getType() {
|
||||
return outType;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,6 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorImpl i
|
||||
|
||||
@Override
|
||||
public JetType getReturnType() {
|
||||
return getOutType();
|
||||
return getType();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class AnnotationResolver {
|
||||
List<JetExpression> argumentExpressions = descriptorToArgument.getValue().getArgumentExpressions();
|
||||
ValueParameterDescriptor parameterDescriptor = descriptorToArgument.getKey();
|
||||
for (JetExpression argument : argumentExpressions) {
|
||||
arguments.add(resolveAnnotationArgument(argument, parameterDescriptor.getOutType()));
|
||||
arguments.add(resolveAnnotationArgument(argument, parameterDescriptor.getType()));
|
||||
}
|
||||
}
|
||||
descriptor.setValueArguments(arguments);
|
||||
|
||||
@@ -468,12 +468,12 @@ public class BodyResolver {
|
||||
private void resolvePropertyInitializer(JetProperty property, PropertyDescriptor propertyDescriptor, JetExpression initializer, JetScope scope) {
|
||||
//JetFlowInformationProvider flowInformationProvider = context.getDescriptorResolver().computeFlowData(property, initializer); // TODO : flow JET-15
|
||||
ExpressionTypingServices typeInferrer = context.getSemanticServices().getTypeInferrerServices(trace);
|
||||
JetType expectedTypeForInitializer = property.getPropertyTypeRef() != null ? propertyDescriptor.getOutType() : NO_EXPECTED_TYPE;
|
||||
JetType expectedTypeForInitializer = property.getPropertyTypeRef() != null ? propertyDescriptor.getType() : NO_EXPECTED_TYPE;
|
||||
JetType type = typeInferrer.getType(context.getDescriptorResolver().getPropertyDeclarationInnerScope(scope, propertyDescriptor, propertyDescriptor.getTypeParameters(), propertyDescriptor.getReceiverParameter()), initializer, expectedTypeForInitializer);
|
||||
//
|
||||
// JetType expectedType = propertyDescriptor.getInType();
|
||||
// if (expectedType == null) {
|
||||
// expectedType = propertyDescriptor.getOutType();
|
||||
// expectedType = propertyDescriptor.getType();
|
||||
// }
|
||||
// if (type != null && expectedType != null
|
||||
// && !context.getSemanticServices().getTypeChecker().isSubtypeOf(type, expectedType)) {
|
||||
@@ -528,7 +528,7 @@ public class BodyResolver {
|
||||
JetParameter jetParameter = valueParameters.get(i);
|
||||
JetExpression defaultValue = jetParameter.getDefaultValue();
|
||||
if (defaultValue != null) {
|
||||
typeInferrer.getType(declaringScope, defaultValue, valueParameterDescriptor.getOutType());
|
||||
typeInferrer.getType(declaringScope, defaultValue, valueParameterDescriptor.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,11 +708,11 @@ public class DescriptorResolver {
|
||||
JetType type;
|
||||
JetTypeReference typeReference = parameter.getTypeReference();
|
||||
if (typeReference == null) {
|
||||
type = propertyDescriptor.getOutType(); // TODO : this maybe unknown at this point
|
||||
type = propertyDescriptor.getType(); // TODO : this maybe unknown at this point
|
||||
}
|
||||
else {
|
||||
type = typeResolver.resolveType(scope, typeReference);
|
||||
JetType inType = propertyDescriptor.getOutType();
|
||||
JetType inType = propertyDescriptor.getType();
|
||||
if (inType != null) {
|
||||
if (!TypeUtils.equalTypes(type, inType)) {
|
||||
trace.report(WRONG_SETTER_PARAMETER_TYPE.on(setter, typeReference, inType));
|
||||
@@ -762,7 +762,7 @@ public class DescriptorResolver {
|
||||
if (getter != null) {
|
||||
List<AnnotationDescriptor> annotations = annotationResolver.resolveAnnotations(scope, getter.getModifierList());
|
||||
|
||||
JetType outType = propertyDescriptor.getOutType();
|
||||
JetType outType = propertyDescriptor.getType();
|
||||
JetType returnType = outType;
|
||||
JetTypeReference returnTypeReference = getter.getReturnTypeReference();
|
||||
if (returnTypeReference != null) {
|
||||
@@ -782,7 +782,7 @@ public class DescriptorResolver {
|
||||
}
|
||||
else {
|
||||
getterDescriptor = createDefaultGetter(propertyDescriptor);
|
||||
getterDescriptor.initialize(propertyDescriptor.getOutType());
|
||||
getterDescriptor.initialize(propertyDescriptor.getType());
|
||||
}
|
||||
return getterDescriptor;
|
||||
}
|
||||
@@ -872,7 +872,7 @@ public class DescriptorResolver {
|
||||
PropertySetterDescriptor setter = createDefaultSetter(propertyDescriptor);
|
||||
|
||||
propertyDescriptor.initialize(getter, setter);
|
||||
getter.initialize(propertyDescriptor.getOutType());
|
||||
getter.initialize(propertyDescriptor.getType());
|
||||
|
||||
trace.record(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, parameter, propertyDescriptor);
|
||||
return propertyDescriptor;
|
||||
|
||||
@@ -83,7 +83,7 @@ public interface Importer {
|
||||
return;
|
||||
}
|
||||
if (descriptor instanceof VariableDescriptor) {
|
||||
JetType type = ((VariableDescriptor) descriptor).getOutType();
|
||||
JetType type = ((VariableDescriptor) descriptor).getType();
|
||||
namespaceScope.importScope(type.getMemberScope());
|
||||
}
|
||||
else if (descriptor instanceof ClassDescriptor) {
|
||||
|
||||
@@ -115,7 +115,7 @@ public class OverridingUtil {
|
||||
parameters.add(receiverParameter.getType());
|
||||
}
|
||||
for (ValueParameterDescriptor valueParameterDescriptor : callableDescriptor.getValueParameters()) {
|
||||
parameters.add(valueParameterDescriptor.getOutType());
|
||||
parameters.add(valueParameterDescriptor.getType());
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ public class CallResolver {
|
||||
// We'll type check the arguments later, with the inferred types expected
|
||||
TemporaryBindingTrace traceForUnknown = TemporaryBindingTrace.create(temporaryTrace);
|
||||
ExpressionTypingServices temporaryServices = new ExpressionTypingServices(semanticServices, traceForUnknown);
|
||||
JetType type = temporaryServices.getType(scope, expression, substituteDontCare.substitute(valueParameterDescriptor.getOutType(), Variance.INVARIANT));
|
||||
JetType type = temporaryServices.getType(scope, expression, substituteDontCare.substitute(valueParameterDescriptor.getType(), Variance.INVARIANT));
|
||||
if (type != null && !ErrorUtils.isErrorType(type)) {
|
||||
constraintSystem.addSubtypingConstraint(VALUE_ARGUMENT.assertSubtyping(type, effectiveExpectedType));
|
||||
}
|
||||
@@ -663,7 +663,7 @@ public class CallResolver {
|
||||
private JetType getEffectiveExpectedType(ValueParameterDescriptor valueParameterDescriptor) {
|
||||
JetType effectiveExpectedType = valueParameterDescriptor.getVarargElementType();
|
||||
if (effectiveExpectedType == null) {
|
||||
effectiveExpectedType = valueParameterDescriptor.getOutType();
|
||||
effectiveExpectedType = valueParameterDescriptor.getType();
|
||||
}
|
||||
return effectiveExpectedType;
|
||||
}
|
||||
@@ -1002,7 +1002,7 @@ public class CallResolver {
|
||||
for (int i = 0; i < valueParameters.size(); i++) {
|
||||
ValueParameterDescriptor valueParameter = valueParameters.get(i);
|
||||
JetType expectedType = parameterTypes.get(i);
|
||||
if (!TypeUtils.equalTypes(expectedType, valueParameter.getOutType())) return false;
|
||||
if (!TypeUtils.equalTypes(expectedType, valueParameter.getType())) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-4
@@ -22,8 +22,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.JetSemanticServices;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassKind;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.OverridingUtil;
|
||||
@@ -104,8 +102,8 @@ public class OverloadingConflictResolver {
|
||||
int fSize = fParams.size();
|
||||
if (fSize != gParams.size()) return false;
|
||||
for (int i = 0; i < fSize; i++) {
|
||||
JetType fParamType = fParams.get(i).getOutType();
|
||||
JetType gParamType = gParams.get(i).getOutType();
|
||||
JetType fParamType = fParams.get(i).getType();
|
||||
JetType gParamType = gParams.get(i).getType();
|
||||
|
||||
if (!typeMoreSpecific(fParamType, gParamType)) {
|
||||
return false;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class TaskPrioritizers {
|
||||
variable = DescriptorUtils.filterNonExtensionProperty(scope.getProperties(name));
|
||||
}
|
||||
if (variable != null) {
|
||||
JetType outType = variable.getOutType();
|
||||
JetType outType = variable.getType();
|
||||
if (outType != null && JetStandardClasses.isFunctionType(outType)) {
|
||||
VariableAsFunctionDescriptor functionDescriptor = VariableAsFunctionDescriptor.create(variable);
|
||||
if ((functionDescriptor.getReceiverParameter().exists()) == receiverNeeded) {
|
||||
|
||||
+3
-3
@@ -234,8 +234,8 @@ public class DataFlowInfo {
|
||||
// }
|
||||
//
|
||||
// @Nullable
|
||||
// public JetType getOutType(@NotNull VariableDescriptor variableDescriptor) {
|
||||
// JetType outType = variableDescriptor.getOutType();
|
||||
// public JetType getType(@NotNull VariableDescriptor variableDescriptor) {
|
||||
// JetType outType = variableDescriptor.getType();
|
||||
// if (outType == null) return null;
|
||||
// if (!outType.isNullable()) return outType;
|
||||
// NullabilityFlags nullabilityFlags = nullabilityInfo.get(variableDescriptor);
|
||||
@@ -269,7 +269,7 @@ public class DataFlowInfo {
|
||||
//
|
||||
// @NotNull
|
||||
// public List<JetType> getPossibleTypesForVariable(@NotNull VariableDescriptor variableDescriptor) {
|
||||
// return getPossibleTypes(variableDescriptor, variableDescriptor.getOutType());
|
||||
// return getPossibleTypes(variableDescriptor, variableDescriptor.getType());
|
||||
// }
|
||||
//
|
||||
// public List<JetType> getPossibleTypesForReceiver(@NotNull ReceiverDescriptor receiver) {
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class DataFlowValueFactory {
|
||||
|
||||
@NotNull
|
||||
public DataFlowValue createDataFlowValue(@NotNull VariableDescriptor variableDescriptor) {
|
||||
JetType type = variableDescriptor.getOutType();
|
||||
JetType type = variableDescriptor.getType();
|
||||
return new DataFlowValue(variableDescriptor, type, isStableVariable(variableDescriptor), getImmanentNullability(type));
|
||||
}
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ public class JetStandardClasses {
|
||||
private static List<JetType> toTypes(List<ValueParameterDescriptor> labeledEntries) {
|
||||
List<JetType> result = new ArrayList<JetType>();
|
||||
for (ValueParameterDescriptor entry : labeledEntries) {
|
||||
result.add(entry.getOutType());
|
||||
result.add(entry.getType());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+1
-1
@@ -607,7 +607,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
temporaryTrace.commit();
|
||||
VariableDescriptor resultingDescriptor = resolutionResult.getResultingDescriptor();
|
||||
checkSuper(receiver, resultingDescriptor, context.trace, selectorExpression);
|
||||
return resultingDescriptor.getOutType();
|
||||
return resultingDescriptor.getType();
|
||||
}
|
||||
if (resolutionResult.isAmbiguity() || resolutionResult.singleResult()) {
|
||||
temporaryTrace.commit();
|
||||
|
||||
+3
-3
@@ -89,7 +89,7 @@ public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
|
||||
List<JetType> parameterTypes = Lists.newArrayList();
|
||||
List<ValueParameterDescriptor> valueParameters = functionDescriptor.getValueParameters();
|
||||
for (ValueParameterDescriptor valueParameter : valueParameters) {
|
||||
parameterTypes.add(valueParameter.getOutType());
|
||||
parameterTypes.add(valueParameter.getType());
|
||||
}
|
||||
ReceiverDescriptor receiverParameter = functionDescriptor.getReceiverParameter();
|
||||
JetType receiver = receiverParameter != NO_RECEIVER ? receiverParameter.getType() : null;
|
||||
@@ -161,7 +161,7 @@ public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
|
||||
if (functionTypeExpected && !hasDeclaredValueParameters && expectedValueParameters.size() == 1) {
|
||||
ValueParameterDescriptor valueParameterDescriptor = expectedValueParameters.get(0);
|
||||
ValueParameterDescriptor it = new ValueParameterDescriptorImpl(
|
||||
functionDescriptor, 0, Collections.<AnnotationDescriptor>emptyList(), "it", false, valueParameterDescriptor.getOutType(), valueParameterDescriptor.hasDefaultValue(), valueParameterDescriptor.getVarargElementType()
|
||||
functionDescriptor, 0, Collections.<AnnotationDescriptor>emptyList(), "it", false, valueParameterDescriptor.getType(), valueParameterDescriptor.hasDefaultValue(), valueParameterDescriptor.getVarargElementType()
|
||||
);
|
||||
valueParameterDescriptors.add(it);
|
||||
context.trace.record(AUTO_CREATED_IT, it);
|
||||
@@ -177,7 +177,7 @@ public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
|
||||
}
|
||||
else {
|
||||
if (expectedValueParameters != null && i < expectedValueParameters.size()) {
|
||||
type = expectedValueParameters.get(i).getOutType();
|
||||
type = expectedValueParameters.get(i).getType();
|
||||
}
|
||||
else {
|
||||
context.trace.report(CANNOT_INFER_PARAMETER_TYPE.on(declaredParameter));
|
||||
|
||||
+3
-3
@@ -248,7 +248,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
|
||||
VariableDescriptor variableDescriptor;
|
||||
if (typeReference != null) {
|
||||
variableDescriptor = context.getDescriptorResolver().resolveLocalVariableDescriptor(context.scope.getContainingDeclaration(), context.scope, loopParameter);
|
||||
JetType actualParameterType = variableDescriptor.getOutType();
|
||||
JetType actualParameterType = variableDescriptor.getType();
|
||||
if (expectedParameterType != null &&
|
||||
actualParameterType != null &&
|
||||
!context.semanticServices.getTypeChecker().isSubtypeOf(expectedParameterType, actualParameterType)) {
|
||||
@@ -377,7 +377,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
|
||||
if (hasNextProperty == null) {
|
||||
return null;
|
||||
} else {
|
||||
JetType hasNextReturnType = hasNextProperty.getOutType();
|
||||
JetType hasNextReturnType = hasNextProperty.getType();
|
||||
if (hasNextReturnType == null) {
|
||||
// TODO : accessibility
|
||||
context.trace.report(HAS_NEXT_MUST_BE_READABLE.on(loopRange));
|
||||
@@ -401,7 +401,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
|
||||
if (catchParameter != null) {
|
||||
VariableDescriptor variableDescriptor = context.getDescriptorResolver().resolveLocalVariableDescriptor(context.scope.getContainingDeclaration(), context.scope, catchParameter);
|
||||
JetType throwableType = context.semanticServices.getStandardLibrary().getThrowable().getDefaultType();
|
||||
DataFlowUtils.checkType(variableDescriptor.getOutType(), catchParameter, context.replaceExpectedType(throwableType));
|
||||
DataFlowUtils.checkType(variableDescriptor.getType(), catchParameter, context.replaceExpectedType(throwableType));
|
||||
if (catchBody != null) {
|
||||
WritableScope catchScope = newWritableScopeImpl(context).setDebugName("Catch scope");
|
||||
catchScope.addVariableDescriptor(variableDescriptor);
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ public class ExpressionTypingUtils {
|
||||
|
||||
public static boolean isVariableIterable(@NotNull Project project, @NotNull VariableDescriptor variableDescriptor, @NotNull JetScope scope) {
|
||||
JetExpression expression = JetPsiFactory.createExpression(project, "fake");
|
||||
ExpressionReceiver expressionReceiver = new ExpressionReceiver(expression, variableDescriptor.getOutType());
|
||||
ExpressionReceiver expressionReceiver = new ExpressionReceiver(expression, variableDescriptor.getType());
|
||||
ExpressionTypingContext context = ExpressionTypingContext.newContext(
|
||||
project,
|
||||
JetSemanticServices.createSemanticServices(project),
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
|
||||
VariableDescriptor propertyDescriptor = context.getDescriptorResolver().resolveLocalVariableDescriptor(scope.getContainingDeclaration(), scope, property, context.dataFlowInfo);
|
||||
JetExpression initializer = property.getInitializer();
|
||||
if (property.getPropertyTypeRef() != null && initializer != null) {
|
||||
JetType outType = propertyDescriptor.getOutType();
|
||||
JetType outType = propertyDescriptor.getType();
|
||||
JetType initializerType = facade.getType(initializer, context.replaceExpectedType(outType).replaceScope(scope));
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public class DescriptorRenderer implements Renderer {
|
||||
|
||||
@Override
|
||||
public Void visitVariableDescriptor(VariableDescriptor descriptor, StringBuilder builder) {
|
||||
String typeString = renderPropertyPrefixAndComputeTypeString(builder, Collections.<TypeParameterDescriptor>emptyList(), ReceiverDescriptor.NO_RECEIVER, descriptor.getOutType());
|
||||
String typeString = renderPropertyPrefixAndComputeTypeString(builder, Collections.<TypeParameterDescriptor>emptyList(), ReceiverDescriptor.NO_RECEIVER, descriptor.getType());
|
||||
renderName(descriptor, builder);
|
||||
builder.append(" : ").append(escape(typeString));
|
||||
return super.visitVariableDescriptor(descriptor, builder);
|
||||
@@ -188,7 +188,7 @@ public class DescriptorRenderer implements Renderer {
|
||||
String typeString = renderPropertyPrefixAndComputeTypeString(
|
||||
builder, descriptor.getTypeParameters(),
|
||||
descriptor.getReceiverParameter(),
|
||||
descriptor.getOutType());
|
||||
descriptor.getType());
|
||||
renderName(descriptor, builder);
|
||||
builder.append(" : ").append(escape(typeString));
|
||||
return null;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.jet.compiler;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.google.common.io.Files;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.codegen.PropertyCodegen;
|
||||
@@ -34,7 +33,6 @@ import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.VariableDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaNamespaceDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
@@ -282,7 +280,7 @@ class NamespaceComparator {
|
||||
}
|
||||
sb.append(prop.getName());
|
||||
sb.append(": ");
|
||||
new Serializer(sb).serialize(prop.getOutType());
|
||||
new Serializer(sb).serialize(prop.getType());
|
||||
}
|
||||
|
||||
public void serialize(ValueParameterDescriptor valueParameter) {
|
||||
@@ -297,7 +295,7 @@ class NamespaceComparator {
|
||||
if (valueParameter.getVarargElementType() != null) {
|
||||
serialize(valueParameter.getVarargElementType());
|
||||
} else {
|
||||
serialize(valueParameter.getOutType());
|
||||
serialize(valueParameter.getType());
|
||||
}
|
||||
if (valueParameter.hasDefaultValue()) {
|
||||
sb.append(" = ?");
|
||||
|
||||
@@ -142,7 +142,7 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
||||
List<ValueParameterDescriptor> unsubstitutedValueParameters = resolvedCall.getResultingDescriptor().getValueParameters();
|
||||
for (int i = 0, unsubstitutedValueParametersSize = unsubstitutedValueParameters.size(); i < unsubstitutedValueParametersSize; i++) {
|
||||
ValueParameterDescriptor unsubstitutedValueParameter = unsubstitutedValueParameters.get(i);
|
||||
if (unsubstitutedValueParameter.getOutType().equals(parameterType[i])) {
|
||||
if (unsubstitutedValueParameter.getType().equals(parameterType[i])) {
|
||||
return resolvedCall.getResultingDescriptor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ public abstract class OverrideImplementMethodsHandler implements LanguageCodeIns
|
||||
else {
|
||||
bodyBuilder.append("val ");
|
||||
}
|
||||
bodyBuilder.append(descriptor.getName()).append(": ").append(descriptor.getOutType());
|
||||
ImportClassHelper.addImportDirectiveIfNeeded(descriptor.getOutType(), file);
|
||||
String initializer = defaultInitializer(descriptor.getOutType(), JetStandardLibrary.getInstance());
|
||||
bodyBuilder.append(descriptor.getName()).append(": ").append(descriptor.getType());
|
||||
ImportClassHelper.addImportDirectiveIfNeeded(descriptor.getType(), file);
|
||||
String initializer = defaultInitializer(descriptor.getType(), JetStandardLibrary.getInstance());
|
||||
if (initializer != null) {
|
||||
bodyBuilder.append("=").append(initializer);
|
||||
}
|
||||
@@ -116,9 +116,9 @@ public abstract class OverrideImplementMethodsHandler implements LanguageCodeIns
|
||||
first = false;
|
||||
bodyBuilder.append(parameterDescriptor.getName());
|
||||
bodyBuilder.append(": ");
|
||||
bodyBuilder.append(parameterDescriptor.getOutType().toString());
|
||||
bodyBuilder.append(parameterDescriptor.getType().toString());
|
||||
|
||||
ImportClassHelper.addImportDirectiveIfNeeded(parameterDescriptor.getOutType(), file);
|
||||
ImportClassHelper.addImportDirectiveIfNeeded(parameterDescriptor.getType(), file);
|
||||
}
|
||||
bodyBuilder.append(")");
|
||||
final JetType returnType = descriptor.getReturnType();
|
||||
|
||||
@@ -64,7 +64,7 @@ public final class DescriptorLookupConverter {
|
||||
@Override
|
||||
public String fun(ValueParameterDescriptor valueParameterDescriptor) {
|
||||
return valueParameterDescriptor.getName() + ":" +
|
||||
DescriptorRenderer.TEXT.renderType(valueParameterDescriptor.getOutType());
|
||||
DescriptorRenderer.TEXT.renderType(valueParameterDescriptor.getType());
|
||||
}
|
||||
}, ",") + ")";
|
||||
|
||||
@@ -78,7 +78,7 @@ public final class DescriptorLookupConverter {
|
||||
}
|
||||
}
|
||||
else if (descriptor instanceof VariableDescriptor) {
|
||||
JetType outType = ((VariableDescriptor) descriptor).getOutType();
|
||||
JetType outType = ((VariableDescriptor) descriptor).getType();
|
||||
typeText = DescriptorRenderer.TEXT.renderType(outType);
|
||||
}
|
||||
else if (descriptor instanceof ClassDescriptor) {
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ public class JetFunctionParameterInfoHandler implements
|
||||
}
|
||||
|
||||
private static JetType getActualParameterType(ValueParameterDescriptor descriptor) {
|
||||
JetType paramType = descriptor.getOutType();
|
||||
JetType paramType = descriptor.getType();
|
||||
if (descriptor.getVarargElementType() != null) paramType = descriptor.getVarargElementType();
|
||||
return paramType;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ public class JetStructureViewElement implements StructureViewTreeElement {
|
||||
@Override
|
||||
public String fun(ValueParameterDescriptor valueParameterDescriptor) {
|
||||
return valueParameterDescriptor.getName() + ":" +
|
||||
DescriptorRenderer.TEXT.renderType(valueParameterDescriptor.getOutType());
|
||||
DescriptorRenderer.TEXT.renderType(valueParameterDescriptor.getType());
|
||||
}
|
||||
},
|
||||
",");
|
||||
@@ -201,7 +201,7 @@ public class JetStructureViewElement implements StructureViewTreeElement {
|
||||
textBuilder.append(":").append(DescriptorRenderer.TEXT.renderType(returnType));
|
||||
}
|
||||
else if (descriptor instanceof VariableDescriptor) {
|
||||
JetType outType = ((VariableDescriptor) descriptor).getOutType();
|
||||
JetType outType = ((VariableDescriptor) descriptor).getType();
|
||||
|
||||
textBuilder = new StringBuilder(descriptor.getName());
|
||||
textBuilder.append(":").append(DescriptorRenderer.TEXT.renderType(outType));
|
||||
|
||||
Reference in New Issue
Block a user