APrioriInvestments / typed_python

An llvm-based framework for generating and calling into high-performance native code from Python.
Apache License 2.0
197 stars 8 forks source link

Compiler doesn't allow class Member to be a specific alternative subtype #418

Open braxtonmckee opened 1 year ago

braxtonmckee commented 1 year ago

For instance,

T = Alternative("T", X=dict(x=int), Y=dict(y=float))

class C(Class):
    anX = Member(T.X)

    def __init__(self):
        self.anX = T.X()

Doesn't work, both because the call to T.X() knows the result as T, not T.X (which is just imprecise) and because we don't have appropriate converters set up.