Skip to content

Commit

Permalink
[lang] Apply JLS 8.4.8.
Browse files Browse the repository at this point in the history
see #621

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Oct 24, 2017
1 parent 9b7bf2c commit c809657
Show file tree
Hide file tree
Showing 6 changed files with 1,368 additions and 209 deletions.
Expand Up @@ -30,8 +30,10 @@
import org.eclipse.xtext.service.SingletonBinding;
import org.eclipse.xtext.validation.CompositeEValidator;
import org.eclipse.xtext.validation.IssueSeveritiesProvider;
import org.eclipse.xtext.xbase.typesystem.override.OverrideHelper;

import io.sarl.lang.bugfixes.pending.bug621.Bug621SARLValidator;
import io.sarl.lang.bugfixes.pending.bug621.Bug621OverrideHelper;
import io.sarl.lang.bugfixes.pending.bug621.Bug621Validator;
import io.sarl.lang.validation.ConfigurableIssueSeveritiesProvider;
import io.sarl.lang.validation.IConfigurableIssueSeveritiesProvider;
import io.sarl.lang.validation.SARLValidator;
Expand Down Expand Up @@ -96,7 +98,12 @@ public void configure(Binder binder) {
@Override
@SingletonBinding(eager = true)
public Class<? extends SARLValidator> bindSARLValidator() {
return Bug621SARLValidator.class;
return Bug621Validator.class;
}

@SuppressWarnings({ "static-method", "javadoc" })
public Class<? extends OverrideHelper> bindOverrideHelper() {
return Bug621OverrideHelper.class;
}

}
@@ -0,0 +1,63 @@
/*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014-2017 the original authors or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.sarl.lang.bugfixes.pending.bug621;

import com.google.inject.Inject;
import org.eclipse.xtext.util.JavaVersion;
import org.eclipse.xtext.xbase.typesystem.override.OverrideHelper;
import org.eclipse.xtext.xbase.typesystem.override.OverrideTester;
import org.eclipse.xtext.xbase.typesystem.override.ResolvedFeatures;
import org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference;

/**
* Fixing the SARL issue 621: Error on multiple function inheritance.
*
* <p>Issue is due to Xtend issue 191 (https://github.com/eclipse/xtext-xtend/pull/191),
* and the associated PR 192 (https://github.com/eclipse/xtext-xtend/pull/192)
*
* <p>Search for "START CHANGE" comment for finding the specific fixes of this class.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @see "https://github.com/sarl/sarl/issues/621"
* @see "https://github.com/eclipse/xtext-xtend/pull/191"
* @see "https://github.com/eclipse/xtext-xtend/pull/192"
*/
@SuppressWarnings("all")
public class Bug621OverrideHelper extends OverrideHelper {

@Inject
private OverrideTester overrideTester;

@Override
public ResolvedFeatures getResolvedFeatures(LightweightTypeReference contextType) {
return new Bug621ResolvedFeatures(contextType, this.overrideTester);
}

@Override
public ResolvedFeatures getResolvedFeatures(LightweightTypeReference contextType, JavaVersion targetVersion) {
return new Bug621ResolvedFeatures(contextType, this.overrideTester, targetVersion);
}

}

0 comments on commit c809657

Please sign in to comment.