// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package jwj

class G1<T> {
    T o;
}

class GP {
    String toString() {
        return "GP"
    }
}

class GC extends GP {
    String toString() {
        return "GC"
    }
}

class G2<T extends GP> {
    T o;
}

o1int = new G1<Integer>(o: 123)
println(o1int.o)
o1infint = new G1(o: 123)
println(o1infint.o)
o1string = new G1<String>(o: "ABC")
println(o1string.o)
o1infstring = new G1(o: "ABC")
println(o1infstring.o)
//dummy = new G2(o: 123) // Note: runtime error not compile time error
//dummy = new G2(o: "ABC") // Note: runtime error not compile time error
o2p = new G2(o: new GP())
println(o2p.o)
o2c = new G2(o: new GC())
println(o2c.o)
