Generic constructors

swift
java
iodine
silver
(Dante Broggi) #1

IDE: Visual Studio X/Fire
Version: 10.0.0.2399 (develop)
Target (If relevant): NET
Description:
Swift allows generic initializers, therefore I would expect either the error to mention it’s being specific to Silver, or to allow it because Java allows generic constructors (docs).

However, it would seem form a little testing that Elements does not support generic constructors in Iodine either. (example source)

Expected Behavior:
“E: Generics not allowed here in Silver [<file> (<line>)]”
Or, preferably:
Compiles.
Actual Behavior:
(A) “E: Generics not allowed here [<file> (<line>)]”
(B) “E: identifier expected, got opening parenthesis [<file> (<line>)]”
Steps:
Silver:

class S {
    init<T>(_ t: T) {} // Error A
}

Iodine:

class Test {
    public <T> Test(T item) { // Error B
       //
    }
}
(RemObjects) #2

Thanks, logged as bugs://82615

(Carlo Kok) #3

I’m going to solve the erroring (so it properly parses it) and log a separate research issue for actually supporting this feature in the future.

(RemObjects) #4

Thanks, logged as bugs://82634

(RemObjects) #5

bugs://82615 got closed with status fixed.