Skip to content

Commit

Permalink
operation contributors can return EolCollection objects
Browse files Browse the repository at this point in the history
  • Loading branch information
pkourouklidis committed Nov 20, 2024
1 parent ca71017 commit a8f24e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import java.util.stream.LongStream;

import org.eclipse.epsilon.eol.staticanalyser.types.EolPrimitiveType;
import org.eclipse.epsilon.eol.staticanalyser.types.EolNativeType;
import org.eclipse.epsilon.eol.staticanalyser.types.EolType;
import org.eclipse.epsilon.eol.types.NumberUtil;

Expand All @@ -22,10 +22,9 @@ public boolean contributesTo(Object target) {
return target instanceof Number;
}

//TODO Replace this with EolNativeType<Number>
@Override
public EolType contributesToType() {
return EolPrimitiveType.Integer;
return new EolNativeType(Number.class);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,22 @@ public EolType javaClassToEolType(Class<?> javaClass) {
return EolCollectionType.Set;
} else if (javaClass == java.util.Map.class) {
return EolMapType.Map;
} else if (javaClass == org.eclipse.epsilon.eol.types.EolCollection.class) {
return EolCollectionType.Collection;
} else if (javaClass == org.eclipse.epsilon.eol.types.EolBag.class) {
return EolCollectionType.Bag;
} else if (javaClass == org.eclipse.epsilon.eol.types.EolSequence.class) {
return EolCollectionType.Sequence;
} else if (javaClass == org.eclipse.epsilon.eol.types.EolSet.class) {
return EolCollectionType.Set;
} else if (javaClass == org.eclipse.epsilon.eol.types.EolOrderedSet.class) {
return EolCollectionType.OrderedSet;
} else if (javaClass == org.eclipse.epsilon.eol.types.concurrent.EolConcurrentBag.class) {
return EolCollectionType.ConcurrentBag;
} else if (javaClass == org.eclipse.epsilon.eol.types.concurrent.EolConcurrentSet.class) {
return EolCollectionType.ConcurrentSet;
} else if (javaClass == org.eclipse.epsilon.eol.types.concurrent.EolConcurrentMap.class) {
return EolMapType.ConcurrentMap;
} else {
return new EolNativeType(javaClass);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
/*Native<java.lang.Number>*/1.1.max(2.2);
/*Native<java.lang.Number>*/1.1.min(2.2);
/*Native<java.lang.Number>*/1.1.pow(2.2);
/*Integer*/1.1.round();


/*Integer*/1.1.round();

0 comments on commit a8f24e1

Please sign in to comment.