Bug 471022 - Problem with varargs augmentation
Summary: Problem with varargs augmentation
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Golo (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL: https://github.com/golo-lang/golo-lan...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-25 11:05 EDT by Thierry Chantier CLA
Modified: 2016-05-25 10:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry Chantier CLA 2015-06-25 11:05:24 EDT
yloiseau commented 21 days ago

The following Golo code:

struct Test = { v }

augment Test {
  function foo = |this, args...| -> "## Hey: " + this: v(): toString() + args: asList(): toString()
}

function main = |args| {
  let f = Test(42)
  println(f: foo("a"))
  println(f: foo())
}

gives:

## Hey: 42[a]
Exception in thread "main" java.lang.NoSuchMethodError: class pb.types.Test::foo
    at fr.insalyon.citi.golo.runtime.MethodInvocationSupport.findTarget(MethodInvocationSupport.java:217)
    at fr.insalyon.citi.golo.runtime.MethodInvocationSupport.lookupTarget(MethodInvocationSupport.java:141)
...