Details
Description
Code is self explainatory.
contents inline, tabs-be-damned.
"""
Hello, World
Hello, World
"""
import System
vars = ("Hello", "World")
Console.WriteLine("{0}, {1}", *vars) #Broken!
Console.WriteLine("{0}, {1}", vars[0], vars[1]) #Not Broken
Issue Links
| This issue is duplicated by: | ||||
| BOO-605 | Varargs messes up if there are multiple methods with the same name. |
|
|
|
It may have something to do with overloaded methods. The example below just has internal calls and it fails too.
//comment out this 1st method and this script will work
def doit(s as string):
print "doit1", s
def doit(s as string, *args as (object)):
print "doit2", s, join(args,"-")
vars = ("Hello", "World")
doit("{0}, {1}", *vars)
Also in python you can use the unpack operator with methods that don't take a variable number of parameters, but this doesn't work in boo:
def testit(s1, s2, s3):
print s1, s2, s3
vars = ("Hello", "World", "!!!")
testit(*vars) //would unpack into:
//testit(vars[0], vars[1], vars[2])