Skip to content

Add a test which uses a forward reference as a type annotation of an argument

This example fails, but I don't really know why 🤔.

import jpype
import typing

if typing.TYPE_CHECKING:
    java = jpype.JPackage("java")

def foo(arg: "java.lang.Throwable"):  # Fails here: Name "java.lang.Throwable" is not defined
    pass

What is weird is that I can reveal_type(java.lang.Throwable) before the definition just fine.

Merge request reports