fixed bugs in impl
This commit is contained in:
parent
1efbbe832f
commit
dfc393064e
@ -5,7 +5,7 @@ from top_level import *
|
|||||||
test = """
|
test = """
|
||||||
class A:
|
class A:
|
||||||
a: int
|
a: int
|
||||||
def foo(a: B) -> int:
|
def foo(a: B):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class B(A):
|
class B(A):
|
||||||
|
@ -16,7 +16,7 @@ class Context:
|
|||||||
|
|
||||||
def parse_type(ctx: Context, ty):
|
def parse_type(ctx: Context, ty):
|
||||||
if ty is None:
|
if ty is None:
|
||||||
return None
|
return None, set()
|
||||||
elif isinstance(ty, ast.Name):
|
elif isinstance(ty, ast.Name):
|
||||||
if ty.id in ctx.types:
|
if ty.id in ctx.types:
|
||||||
return ctx.types[ty.id], set()
|
return ctx.types[ty.id], set()
|
||||||
@ -52,6 +52,8 @@ def parse_type(ctx: Context, ty):
|
|||||||
return VirtualClassType(param), var
|
return VirtualClassType(param), var
|
||||||
else:
|
else:
|
||||||
raise CustomError(f"Unknown Generic Type {ty.value}")
|
raise CustomError(f"Unknown Generic Type {ty.value}")
|
||||||
|
else:
|
||||||
|
raise CustomError(f"Unrecognized Type {ty}")
|
||||||
|
|
||||||
|
|
||||||
def parse_function(ctx: Context, base, fn: ast.FunctionDef):
|
def parse_function(ctx: Context, base, fn: ast.FunctionDef):
|
||||||
|
Loading…
Reference in New Issue
Block a user