[Types-sig] how to do a typecase? (was: Static typing: Towards closure?)

Tim Peters tim_one@email.msn.com
Sun, 23 Jan 2000 22:55:20 -0500


[John Skaller, on def f(): return f]
> ...
> 	The question is: what will a type checker do,
> seeing this function? Will it loop forever trying to compute
> the type of f?

I still won't call this a "type checking" problem; it's a (potential)
problem for a type *inferencer*, but:

> 	The answer is: probably. And we must allow this if type
> declations are optional. The only way to disallow the above
> function is to require everything be explicitly typed, in
> which case there is no way to name the type of the function
> above.

Bingo.  Checking that use matches declaration is easier than inferring
declaration from use.  "Mere checking" is hard enough for a first version,
though!