| Summary: | [Xtend] Varargs method call with overloaded non-varargs method is broken | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Ingo Meyer <ingo.meyer> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | sebastian.zarnekow, sven.efftinge |
| Version: | unspecified | Flags: | sven.efftinge:
indigo+
|
| Target Milestone: | SR2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
Build Identifier: 20110609-2236 When calling a method with a varargs parameter which itself is overloaded with a method without varargs it will give the error "Invalid number of arguments. Expected (String)" in an Xtend editor. This is since a nightly build after 2.0.1 stable. I currently tested with 2.0.1.v201109050027 Reproducible: Always Steps to Reproduce: 1. Use this class public class VarargsTest { public static final VarargsTest LOG = new VarargsTest(); public String info (String msg) { return msg; } public String info (String msg, Object... args) { return MessageFormat.format( msg, args ); } public static void main(String[] args) { String a = VarargsTest.LOG.info("hello world"); String b = VarargsTest.LOG.info("hello {0}","world"); System.out.println(a); System.out.println(b); } } 2. Try to use it in any Xtend class via inject or static access @Inject extension VarargsTest varargsTest varargsTest.info('hello {0}','world') VarargsTest::LOG.info('hello {0}','world') 3. Failes with validation error "Invalid number of arguments. Expected (String)"