Projects >> xtext >>ddd1c12c0543a7ad96c16d3b12aa4c9f89d953bb

Chunk
Conflicting content
=======
		@Override

		protected LazyExpectation(JvmTypeReference declaredType) {
			this.declaredType = declaredType;
<<<<<<< HEAD
			substitutor = getState().createSubstitutor(getDeclaratorParameterMapping());
			substitutor.enhanceMapping(getFeatureTypeParameterMapping());
			substitutor = new UnboundTypeParameterPreservingSubstitutor(getDeclaratorParameterMapping(), getState().getServices()) {
				@Override
				public JvmTypeReference doVisitComputedTypeReference(XComputedTypeReference reference,
						Set param) {
					if (UnboundTypeParameters.isUnboundTypeParameter(reference)) {
						XComputedTypeReference result = getServices().getXtypeFactory().createXComputedTypeReference();
						UnboundTypeParameter typeParameter = (UnboundTypeParameter) reference.getTypeProvider();
						result.setTypeProvider(types.getUnboundTypeParameter(typeParameter.getHandle()));
						return result;
					}
					return super.doVisitComputedTypeReference(reference, param);
				}
			};
			substitutor.enhanceMapping(typeParameterMapping);
		}
		
		protected void setTypes(ResolvedTypes types) {
			this.types = types;
>>>>>>> 791341109925ee7e498cd8bb7e0ef26febffddb2
		}
Solution content
		protected LazyExpectation(JvmTypeReference declaredType) {
			this.declaredType = declaredType;
			substitutor = getState().createSubstitutor(getDeclaratorParameterMapping());
			substitutor.enhanceMapping(typeParameterMapping);
		}

		@Override
File
AbstractLinkingCandidateWithTypeParameter.java
Developer's decision
Combination
Kind of conflict
Attribute
Method invocation
Method signature
Chunk
Conflicting content
						Set param) {
					if (UnboundTypeParameters.isUnboundTypeParameter(reference)) {
						XComputedTypeReference result = getServices().getXtypeFactory().createXComputedTypeReference();
<<<<<<< HEAD
						UnboundTypeParameter unboundTypeParameter = (UnboundTypeParameter) reference.getTypeProvider();
						BaseUnboundTypeParameter stacked = getState().getResolvedTypes().getUnboundTypeParameter(unboundTypeParameter.getHandle());
						result.setTypeProvider(stacked);
=======
						UnboundTypeParameter parameter = (UnboundTypeParameter) reference.getTypeProvider();
						result.setTypeProvider(parameter); // getState().getResolvedTypes().getUnboundTypeParameter(parameter.getHandle()));
>>>>>>> 791341109925ee7e498cd8bb7e0ef26febffddb2
						return result;
					}
					return super.doVisitComputedTypeReference(reference, param);
Solution content
						Set param) {
					if (UnboundTypeParameters.isUnboundTypeParameter(reference)) {
						XComputedTypeReference result = getServices().getXtypeFactory().createXComputedTypeReference();
						UnboundTypeParameter unboundTypeParameter = (UnboundTypeParameter) reference.getTypeProvider();
						BaseUnboundTypeParameter stacked = getState().getResolvedTypes().getUnboundTypeParameter(unboundTypeParameter.getHandle());
						result.setTypeProvider(stacked);
						return result;
					}
					return super.doVisitComputedTypeReference(reference, param);
File
AbstractLinkingCandidateWithTypeParameter.java
Developer's decision
Version 1
Kind of conflict
Cast expression
Comment
Method invocation
Variable
Chunk
Conflicting content
		if (feature instanceof JvmTypeParameterDeclarator) {
			List typeParameters = ((JvmTypeParameterDeclarator) feature).getTypeParameters();
			if (!typeParameters.isEmpty()) {
<<<<<<< HEAD
				ActualTypeArgumentCollector implementation = getState().createTypeArgumentCollector(typeParameters, BoundTypeArgumentSource.EXPECTATION);
=======
				ActualTypeArgumentCollector implementation = new UnboundTypeParameterAwareTypeArgumentCollector(typeParameters, BoundTypeArgumentSource.EXPECTATION, getState().getServices()) {
					@Override
					protected void acceptHint(UnboundTypeParameter typeParameter, JvmTypeReference param) {
						BaseUnboundTypeParameter stacked = getState().getResolvedTypes().getUnboundTypeParameter(typeParameter.getHandle());
						super.acceptHint(stacked, param);
					}
				};
>>>>>>> 791341109925ee7e498cd8bb7e0ef26febffddb2
				implementation.populateTypeParameterMapping(declaredType, actualType);
				ListMultimap parameterMapping = implementation.rawGetTypeParameterMapping();
				for(Map.Entry entry: parameterMapping.entries()) {
Solution content
		if (feature instanceof JvmTypeParameterDeclarator) {
			List typeParameters = ((JvmTypeParameterDeclarator) feature).getTypeParameters();
			if (!typeParameters.isEmpty()) {
				ActualTypeArgumentCollector implementation = getState().createTypeArgumentCollector(typeParameters, BoundTypeArgumentSource.EXPECTATION);
//				ActualTypeArgumentCollector implementation = new UnboundTypeParameterAwareTypeArgumentCollector(typeParameters, BoundTypeArgumentSource.EXPECTATION, getState().getServices()) {
//					@Override
//					protected void acceptHint(UnboundTypeParameter typeParameter, JvmTypeReference param) {
//						BaseUnboundTypeParameter stacked = getState().getResolvedTypes().getUnboundTypeParameter(typeParameter.getHandle());
//						super.acceptHint(stacked, param);
//					}
//				};
				implementation.populateTypeParameterMapping(declaredType, actualType);
				ListMultimap parameterMapping = implementation.rawGetTypeParameterMapping();
				for(Map.Entry entry: parameterMapping.entries()) {
File
AbstractLinkingCandidateWithTypeParameter.java
Developer's decision
Manual
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		if (boundTo != null) {
			throw new IllegalStateException("Type parameter was already bound. No more hints may be accepted.");
		}
<<<<<<< HEAD
		JvmTypeReference hint = boundArgument.getTypeReference();
		if (hint instanceof XComputedTypeReference) {
			IJvmTypeReferenceProvider typeProvider = ((XComputedTypeReference) hint).getTypeProvider();
			if (typeProvider instanceof BaseUnboundTypeParameter) {
				BaseUnboundTypeParameter other = (BaseUnboundTypeParameter) typeProvider;
				if (other.getResolvedTypes() != getResolvedTypes()) {
					throw new IllegalStateException("Other unbound parameter was not substituted properly");
				}
				if (other.getBoundTo() != null) {
					throw new IllegalStateException("Other parameter was already bound");
				} else {
					if (other.getHandle().equals(getHandle())) {
						throw new IllegalStateException("Cannot add recursive hint");
=======
		if (boundArgument.getSource() == BoundTypeArgumentSource.EXPLICIT) {
			boundTo = new MergedBoundTypeArgument(boundArgument.getTypeReference(), boundArgument.getActualVariance());
		} else {
			JvmTypeReference hint = boundArgument.getTypeReference();
			if (hint instanceof XComputedTypeReference) {
				IJvmTypeReferenceProvider typeProvider = ((XComputedTypeReference) hint).getTypeProvider();
				if (typeProvider instanceof BaseUnboundTypeParameter) {
					BaseUnboundTypeParameter other = (BaseUnboundTypeParameter) typeProvider;
//					other = resolvedTypes.getUnboundTypeParameter(other.getHandle());
					if (other.getBoundTo() != null) {
						throw new IllegalStateException();
					} else {
						if (other.getHandle().equals(getHandle())) {
							throw new IllegalStateException("Cannot add recursive hint");
						}
						equallyBoundHandles.add(other.getHandle());
						other.equallyBoundHandles.add(getHandle());
						return;
>>>>>>> 791341109925ee7e498cd8bb7e0ef26febffddb2
					}
				}
			}
Solution content
		if (boundTo != null) {
			throw new IllegalStateException("Type parameter was already bound. No more hints may be accepted.");
		}
		
		if (boundArgument.getSource() == BoundTypeArgumentSource.EXPLICIT) {
			boundTo = new MergedBoundTypeArgument(boundArgument.getTypeReference(), boundArgument.getActualVariance());
		} else {
			JvmTypeReference hint = boundArgument.getTypeReference();
			if (hint instanceof XComputedTypeReference) {
				IJvmTypeReferenceProvider typeProvider = ((XComputedTypeReference) hint).getTypeProvider();
				if (typeProvider instanceof BaseUnboundTypeParameter) {
					BaseUnboundTypeParameter other = (BaseUnboundTypeParameter) typeProvider;
					if (other.getResolvedTypes() != getResolvedTypes()) {
						throw new IllegalStateException("Other unbound parameter was not substituted properly");
					}
					if (other.getBoundTo() != null) {
						throw new IllegalStateException("Other parameter was already bound");
					} else {
						if (other.getHandle().equals(getHandle())) {
							throw new IllegalStateException("Cannot add recursive hint");
						}
						equallyBoundHandles.add(other.getHandle());
						other.equallyBoundHandles.add(getHandle());
						return;
					}
				}
			}
File
BaseUnboundTypeParameter.java
Developer's decision
Combination
Kind of conflict
Attribute
Cast expression
Comment
If statement
Method invocation
Return statement
Throw statement
Variable