summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/analyzer/features/null_initializer.gd
blob: 5a413e201504d8e39e05f27545ef69dde0ebd448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
func check(input: int) -> bool:
	return input == 1

var recur = null
var prop = null

func check_arg(arg = null) -> void:
	if arg != null:
		print(check(arg))

func check_recur() -> void:
	if recur != null:
		print(check(recur))
	else:
		recur = 1
		check_recur()

func test() -> void:
	check_arg(1)

	check_recur()

	if prop == null:
		set('prop', 1)
		print(check(prop))
		set('prop', null)

	var loop = null
	while loop != 2:
		if loop != null:
			print(check(loop))
		loop = 1 if loop == null else 2