[Types-sig] recursive types, type safety, and flow analysis
Paul Prescod
paul@prescod.net
Wed, 22 Dec 1999 17:10:19 -0600
Greg Stein wrote:
>
> I'm talking about figuring out types from the assignments, not from
> declarations. That's it. Forget declarations and the clutter that they
> bring to programs.
Okay, let's try again.
a.py:
a=5
if something():
a = 5
elif somethingElse():
a = "abc"
elif somethingElse2():
a = 32L
elif somethingElse3():
a = ["ab"]
else:
del a
b.py:
import a
a.a = "jab"
c.py:
import a
a.a = ("abc",5)
d.py:
import a, b, c
j: Int
j = a.a
What's the error message? What are the list of valid types that a.a
could have at this point and how would the type system have inferred
them?
Paul Prescod