Boo

Explode operator not exploding when using overloaded methods

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.5.6
  • Fix Version/s: 0.7.5
  • Component/s: Compiler
  • Labels:
    None
  • Number of attachments :
    0

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

Activity

Hide
Doug H added a comment -

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])

Show
Doug H added a comment - 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])
Hide
Arron Washington added a comment -

bump

Someone just butted heads with this issue in a "real life" application where they are consuming this method signature - ie, they can't change it themselves. Can it get some love from a willing volunteer?

By the way, duck typing is a hacky work-around for this issue until it can be resolved properly.

Show
Arron Washington added a comment - bump Someone just butted heads with this issue in a "real life" application where they are consuming this method signature - ie, they can't change it themselves. Can it get some love from a willing volunteer? By the way, duck typing is a hacky work-around for this issue until it can be resolved properly.
Hide
Doug H added a comment -

This duplicates BOO-408

Show
Doug H added a comment - This duplicates BOO-408

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: