Basilisk doesn't seem to handle rather basic examples involving generics, for example:
from typing import assert_type
class P: ...
def duplicate[T](value: T) -> tuple[T, T]:
return value, value
assert_type(duplicate(P()), tuple[P, P])
Basilisk fails this assertion and incorrectly infers tuple[T, T] (leaking type variables) instead of tuple[P, P].
Using list[T] or int | T in the return type leads to similar failures.
It also seems to rely on the fact that type variables are capitalized? It fails this assertion and infers t instead of int:
def identity[t](value: t) -> t:
return value
assert_type(identity(1), int)
Basilisk doesn't seem to handle rather basic examples involving generics, for example:
Basilisk fails this assertion and incorrectly infers
tuple[T, T](leaking type variables) instead oftuple[P, P].Using
list[T]orint | Tin the return type leads to similar failures.It also seems to rely on the fact that type variables are capitalized? It fails this assertion and infers
tinstead ofint: