reorder things

This commit is contained in:
Khaleel Al-Adhami 2024-08-14 15:19:06 -07:00
parent e92218da94
commit 1d45f70dfe

View File

@ -437,13 +437,13 @@ class ImmutableVar(Var, Generic[VAR_TYPE]):
from .object import ObjectVar
from .sequence import ArrayVar, StringVar
if self._var_type is Any:
return self
var_type = self._var_type
if types.is_optional(var_type):
var_type = types.get_args(var_type)[0]
if var_type is Any:
return self
fixed_type = var_type if inspect.isclass(var_type) else get_origin(var_type)
if fixed_type is Union: