Menu

#48 Even better type inference

open
nobody
None
5
2006-08-20
2006-08-20
B S
No

A minor oddity in the type inference.

(nice 0.9.12)
Given a tree of classes like this:
<pre>class A{}
class B extends A{A a;}</pre>

if you have a piece of code like this:
<pre>void doStuff(B aB){
let b = aB.a;
if(b instanceof B){
let x= ()=>{
doStuff(b);
};
}
}</pre>

It will fail saying that the arguments (A) don't fit
doStuff(B aB). Apparently it loses the (b instanceof B)
type information inside of the anonymous function/closure.

Discussion


Log in to post a comment.