GDScript: Improve call analysis
* Add missing `UNSAFE_CALL_ARGUMENT` warning. * Fix `Object` constructor. * Display an error for non-existent static methods.
This commit is contained in:
parent
59139df16e
commit
e8696f9961
25 changed files with 184 additions and 46 deletions
|
|
@ -6,10 +6,12 @@ var prop = null
|
|||
|
||||
func check_arg(arg = null) -> void:
|
||||
if arg != null:
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
print(check(arg))
|
||||
|
||||
func check_recur() -> void:
|
||||
if recur != null:
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
print(check(recur))
|
||||
else:
|
||||
recur = 1
|
||||
|
|
@ -22,11 +24,13 @@ func test() -> void:
|
|||
|
||||
if prop == null:
|
||||
set('prop', 1)
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
print(check(prop))
|
||||
set('prop', null)
|
||||
|
||||
var loop = null
|
||||
while loop != 2:
|
||||
if loop != null:
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
print(check(loop))
|
||||
loop = 1 if loop == null else 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue