Closed thomasfanell closed 8 years ago
Does this also prevent when T or T* is inside a Func given as argument?
@marcusnaslund it does now :)
This will generate an error now:
Foo: abstract class <T> {
test: abstract func (value: T, fn: Func(T) -> Int) -> Int
}
Bar: class <T> extends Foo<T> {
init: func
test: override func (value: T, fn: Func(T*) -> Int) -> Int {
fn(value&)
}
}
bar := Bar<Int> new()
Excellent. :)
Personally I think it's fine, although I do think algo/typeAnalysis.ooc should have tools to help with this kind of thing (but iirc there is nothing about generics in there).
@shamanas thanks, I think we'll settle with this for now then.
Merged via #61
We want to prevent this from compiling:
@shamanas @zhaihj The fix works as expected, but is it too sloppy or plain naive? Suggestions?