Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support python type hints #1701

Merged
merged 11 commits into from
Sep 25, 2024
Prev Previous commit
Next Next commit
Doc string
  • Loading branch information
lshala committed Sep 20, 2024
commit 4ec6d61def9525b0eee15dfbeaa8748c23b81139
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ class PythonLanguageFrontend(language: Language<PythonLanguageFrontend>, ctx: Tr
// No type information -> we return an autoType to infer things magically
autoType()
}

is Python.AST.Name -> {
this.typeOf(type.id)
}

else -> {
// The AST supplied us with some kind of type information, but we could not parse
// it, so we need to return the unknown type.
Expand All @@ -156,10 +154,7 @@ class PythonLanguageFrontend(language: Language<PythonLanguageFrontend>, ctx: Tr
}
}

/**
* Resolves a [Type] based on its string identifier.
* test hook
*/
/** Resolves a [Type] based on its string identifier. */
fun typeOf(typeId: String): Type {
// Check if the typeId contains a namespace delimiter for qualified types
val name =
Expand Down
Loading