Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/TemplateMethodParser.java @ 7753:c17ee8823d72
Fixed bug in method parsing error messages.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 11 Feb 2013 10:40:52 +0100 |
parents | 5f3cba05c2fa |
children | 6b74ffe38183 |
comparison
equal
deleted
inserted
replaced
7752:388848bbe03d | 7753:c17ee8823d72 |
---|---|
231 return null; | 231 return null; |
232 } | 232 } |
233 return new ActualParameter(specification, resolvedType); | 233 return new ActualParameter(specification, resolvedType); |
234 } | 234 } |
235 | 235 |
236 protected static List<TypeDef> createTypeDefinitions(ParameterSpec returnType, List<? extends ParameterSpec> parameters) { | 236 protected List<TypeDef> createTypeDefinitions(ParameterSpec returnType, List<? extends ParameterSpec> parameters) { |
237 List<TypeDef> typeDefs = new ArrayList<>(); | 237 List<TypeDef> typeDefs = new ArrayList<>(); |
238 | 238 |
239 TypeMirror[] types = returnType.getAllowedTypes(); | |
240 List<ParameterSpec> allParams = new ArrayList<>(); | 239 List<ParameterSpec> allParams = new ArrayList<>(); |
241 allParams.add(returnType); | 240 allParams.add(returnType); |
242 allParams.addAll(parameters); | 241 allParams.addAll(parameters); |
243 | 242 |
244 int defIndex = 0; | 243 int defIndex = 0; |
245 for (ParameterSpec spec : allParams) { | 244 for (ParameterSpec spec : allParams) { |
246 TypeMirror[] allowedTypes = spec.getAllowedTypes(); | 245 TypeMirror[] allowedTypes = spec.getAllowedTypes(); |
246 TypeMirror[] types = spec.getAllowedTypes(); | |
247 if (types != null && allowedTypes.length > 1) { | 247 if (types != null && allowedTypes.length > 1) { |
248 TypeDef foundDef = null; | 248 TypeDef foundDef = null; |
249 for (TypeDef def : typeDefs) { | 249 for (TypeDef def : typeDefs) { |
250 if (Arrays.equals(spec.getAllowedTypes(), def.getTypes())) { | 250 if (Arrays.equals(allowedTypes, def.getTypes())) { |
251 foundDef = def; | 251 foundDef = def; |
252 break; | 252 break; |
253 } | 253 } |
254 } | 254 } |
255 if (foundDef == null) { | 255 if (foundDef == null) { |