Mercurial > hg > truffle
changeset 20960:6fe8d8a248ba
Truffle-DSL: fix generic types are not unique in javac.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 15 Apr 2015 00:16:01 +0200 |
parents | bb7e95512781 |
children | d79e1c137fb7 |
files | graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Tue Apr 14 23:13:47 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Wed Apr 15 00:16:01 2015 +0200 @@ -1332,13 +1332,14 @@ List<VariableElement> types = new ArrayList<>(); - Set<TypeMirror> frameTypes = new HashSet<>(); + Collection<TypeMirror> frameTypes = new HashSet<>(); for (SpecializationData specialization : node.getSpecializations()) { if (specialization.getFrame() != null) { frameTypes.add(specialization.getFrame().getType()); } } if (!frameTypes.isEmpty()) { + frameTypes = ElementUtils.uniqueSortedTypes(frameTypes); TypeMirror frameType; if (frameTypes.size() == 1) { frameType = frameTypes.iterator().next(); @@ -1359,7 +1360,7 @@ if (!genericParameter.getSpecification().isSignature()) { polymorphicType = genericParameter.getType(); } else { - Set<TypeMirror> usedTypes = new HashSet<>(); + Collection<TypeMirror> usedTypes = new HashSet<>(); for (SpecializationData specialization : node.getSpecializations()) { if (specialization.isUninitialized()) { continue; @@ -1373,6 +1374,7 @@ } usedTypes.add(parameter.getType()); } + usedTypes = ElementUtils.uniqueSortedTypes(usedTypes); if (usedTypes.size() == 1) { polymorphicType = usedTypes.iterator().next();