nddrylliog/rock — Issue #346: Funny issues with generics and varargs
Author: fredreichbier
Created: 2011-11-30 18:47:34+00:00
State: open

Fun stuff!

```ooc

import structs/HashBag

Pair: class {
k: K
v: V

init: func (=k, =v) {}
}

//operator => (k: K, v: V) -> Pair { Pair new(k, v) }

hashbag: func (args: ...) {
args each(|arg|
pair := arg as Pair
VV := pair V
val := pair v as VV
)
}

hashbag(Pair new("Hello", "World!"), Pair new("leet", 1337))
```

This segfaults. If we change the last line to

```ooc
hashbag(Pair new("Hello", "World!"))
```

it doesn't. Just adding this here for the records, I'll have a look at it and report more details later.