Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Sep 9, 2017
1 parent bfb7603 commit 9c24da7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Expand Up @@ -83,13 +83,6 @@
import com.redhat.ceylon.compiler.typechecker.tree.CustomTree;
import com.redhat.ceylon.compiler.typechecker.tree.Node;
import com.redhat.ceylon.compiler.typechecker.tree.Tree;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.Expression;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.Pattern;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.PositionalArgument;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.Term;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.TuplePattern;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.TypeParameterList;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.VoidModifier;
import com.redhat.ceylon.compiler.typechecker.tree.Visitor;
import com.redhat.ceylon.model.typechecker.model.Cancellable;
import com.redhat.ceylon.model.typechecker.model.Class;
Expand Down Expand Up @@ -670,21 +663,21 @@ private void destructureTuple(Type sequenceType,
}

private void destructureSequence(Type sequenceType,
TuplePattern tuplePattern) {
Tree.TuplePattern tuplePattern) {
List<Tree.Pattern> patterns =
tuplePattern.getPatterns();
int length = patterns.size();
Tree.Pattern lastPattern = patterns.get(length-1);
if (!isVariadicPattern(lastPattern)) {
Pattern pattern = lastPattern;
Tree.Pattern pattern = lastPattern;
if (pattern==null) pattern = tuplePattern;
pattern.addError(
"assigned expression is not a tuple type, so pattern must end in a variadic element: '" +
sequenceType.asString(unit) +
"' is not a tuple type");
}
else if (/*nonempty && length>1 ||*/ length>2) {
Pattern pattern = patterns.get(2);
Tree.Pattern pattern = patterns.get(2);
if (pattern==null) pattern = tuplePattern;
pattern.addError(
"assigned expression is not a tuple type, so pattern must not have more than two elements: '" +
Expand All @@ -693,7 +686,7 @@ else if (/*nonempty && length>1 ||*/ length>2) {
}
else if ((/*nonempty ||*/ length>1) &&
!unit.isSequenceType(sequenceType)) {
Pattern pattern = patterns.get(1);
Tree.Pattern pattern = patterns.get(1);
if (pattern==null) pattern = tuplePattern;
pattern.addError(
"assigned expression is not a nonempty sequence type, so pattern must have exactly one element: '" +
Expand Down Expand Up @@ -1876,7 +1869,7 @@ && hasNullReturnValues(type,
Type it = canonicalIntersection(refinedTypes, unit);
if (allHaveNulls && !unit.isOptionalType(it)) {
methodOrValue.setUncheckedNullType(true);
Term lhs = that.getBaseMemberExpression();
Tree.Term lhs = that.getBaseMemberExpression();
//TODO: this is pretty ugly, think of something better!
lhs.setTypeModel(unit.getOptionalType(lhs.getTypeModel()));
}
Expand Down Expand Up @@ -2375,7 +2368,7 @@ public void visit(Tree.TypedDeclaration that) {
}
}

private static VoidModifier fakeVoid(Node that) {
private static Tree.VoidModifier fakeVoid(Node that) {
return new Tree.VoidModifier(that.getToken());
}

Expand Down Expand Up @@ -4259,15 +4252,15 @@ private void setArgumentParameters(
Tree.PositionalArgumentList pal =
that.getPositionalArgumentList();
if (pal!=null) {
List<PositionalArgument> args =
List<Tree.PositionalArgument> args =
pal.getPositionalArguments();
List<Parameter> params =
pl.getParameters();
for (int i=0, j=0;
i<args.size() &&
j<params.size();
i++) {
PositionalArgument arg =
Tree.PositionalArgument arg =
args.get(i);
Parameter param =
params.get(j);
Expand Down Expand Up @@ -5557,7 +5550,7 @@ else if (!that.getAssigned() &&
(Tree.ElementRange) eor;
Tree.Expression lb = er.getLowerBound();
Tree.Expression ub = er.getUpperBound();
Expression l = er.getLength();
Tree.Expression l = er.getLength();
if (lb!=null) {
checkAssignable(lb.getTypeModel(),
kt, lb,
Expand Down Expand Up @@ -10464,7 +10457,7 @@ public void visit(Tree.ExtendedType that) {

@Override public void visit(Tree.TypeConstraint that) {
super.visit(that);
TypeParameterList typeParams =
Tree.TypeParameterList typeParams =
that.getTypeParameterList();
if (typeParams!=null) {
checkNotJvm(typeParams,
Expand Down
Expand Up @@ -32,8 +32,6 @@
import com.redhat.ceylon.common.Backends;
import com.redhat.ceylon.compiler.typechecker.tree.Node;
import com.redhat.ceylon.compiler.typechecker.tree.Tree;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.StaticType;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.TypeSpecifier;
import com.redhat.ceylon.compiler.typechecker.tree.Visitor;
import com.redhat.ceylon.model.typechecker.model.Cancellable;
import com.redhat.ceylon.model.typechecker.model.Class;
Expand Down Expand Up @@ -1025,7 +1023,7 @@ public void visit(Tree.TypeAliasDeclaration that) {
TypeAlias ta = that.getDeclarationModel();
ta.setExtendedType(null);
super.visit(that);
TypeSpecifier typeSpecifier =
Tree.TypeSpecifier typeSpecifier =
that.getTypeSpecifier();
if (typeSpecifier==null) {
that.addError("missing aliased type");
Expand Down Expand Up @@ -1447,7 +1445,7 @@ else if (type.isTypeParameter()) {
ClassOrInterface ci =
(ClassOrInterface) scope;
if (!ci.isAbstract()) {
StaticType ct = cts.get(0);
Tree.StaticType ct = cts.get(0);
if (ci.equals(td)) {
ct.addError("concrete class parameterized by self type: '"
+ ci.getName()
Expand Down

0 comments on commit 9c24da7

Please sign in to comment.