godot/modules/gdscript/tests/scripts/analyzer/features/ternary_hard_infer.gd

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
499 B
GDScript3
Raw Normal View History

func test():
var left_hard_int := 1
var right_hard_int := 2
var result_hard_int := left_hard_int if true else right_hard_int
Utils.check(result_hard_int == 1)
@warning_ignore("inference_on_variant")
var left_hard_variant := 1 as Variant
@warning_ignore("inference_on_variant")
var right_hard_variant := 2.0 as Variant
@warning_ignore("inference_on_variant")
var result_hard_variant := left_hard_variant if true else right_hard_variant
Utils.check(result_hard_variant == 1)
print('ok')