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