GDScript: Add @warning_ignore_start and @warning_ignore_restore annotations
This commit is contained in:
@@ -13,7 +13,7 @@ func param_inferred(param := variant()) -> void: print(param)
|
||||
func return_untyped(): return variant()
|
||||
func return_typed() -> Variant: return variant()
|
||||
|
||||
@warning_ignore("unused_variable", "inference_on_variant")
|
||||
@warning_ignore_start("unused_variable", "inference_on_variant")
|
||||
func test() -> void:
|
||||
var weak = variant()
|
||||
var typed: Variant = variant()
|
||||
@@ -32,4 +32,4 @@ func test() -> void:
|
||||
if typed != null: pass
|
||||
if typed is Node: pass
|
||||
|
||||
print('ok')
|
||||
print("ok")
|
||||
|
||||
@@ -123,4 +123,4 @@ func test():
|
||||
Utils.check((const_null is A) == false)
|
||||
Utils.check(is_instance_of(const_null, A) == false)
|
||||
|
||||
print('ok')
|
||||
print("ok")
|
||||
|
||||
@@ -20,9 +20,7 @@ class Members:
|
||||
Utils.check(str(two) == '[486]')
|
||||
return true
|
||||
|
||||
|
||||
@warning_ignore("unsafe_method_access")
|
||||
@warning_ignore("return_value_discarded")
|
||||
@warning_ignore_start('unsafe_method_access', 'return_value_discarded')
|
||||
func test():
|
||||
var untyped_basic = [459]
|
||||
Utils.check(str(untyped_basic) == '[459]')
|
||||
@@ -207,7 +205,7 @@ func test():
|
||||
|
||||
var a := A.new()
|
||||
var typed_natives: Array[RefCounted] = [a]
|
||||
var typed_scripts = Array(typed_natives, TYPE_OBJECT, "RefCounted", A)
|
||||
var typed_scripts = Array(typed_natives, TYPE_OBJECT, 'RefCounted', A)
|
||||
Utils.check(typed_scripts[0] == a)
|
||||
|
||||
|
||||
|
||||
@@ -21,9 +21,7 @@ class Members:
|
||||
return true
|
||||
|
||||
|
||||
@warning_ignore("unsafe_method_access")
|
||||
@warning_ignore("assert_always_true")
|
||||
@warning_ignore("return_value_discarded")
|
||||
@warning_ignore_start("unsafe_method_access", "return_value_discarded")
|
||||
func test():
|
||||
var untyped_basic = { 459: 954 }
|
||||
Utils.check(str(untyped_basic) == '{ 459: 954 }')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
signal ok()
|
||||
|
||||
@warning_ignore("return_value_discarded")
|
||||
@warning_ignore_start("return_value_discarded")
|
||||
func test():
|
||||
ok.connect(func(): print('ok'))
|
||||
emit_signal(&'ok')
|
||||
ok.connect(func(): print("ok"))
|
||||
emit_signal(&"ok")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
GDTEST_OK
|
||||
~~ WARNING at line 3: (CONFUSABLE_IDENTIFIER) The identifier "my_vАr" has misleading characters and might be confused with something else.
|
||||
~~ WARNING at line 8: (NARROWING_CONVERSION) Narrowing conversion (float is converted to int and loses precision).
|
||||
~~ WARNING at line 14: (NARROWING_CONVERSION) Narrowing conversion (float is converted to int and loses precision).
|
||||
~~ WARNING at line 19: (NARROWING_CONVERSION) Narrowing conversion (float is converted to int and loses precision).
|
||||
~~ WARNING at line 24: (NARROWING_CONVERSION) Narrowing conversion (float is converted to int and loses precision).
|
||||
~~ WARNING at line 27: (CONFUSABLE_IDENTIFIER) The identifier "_my_vАr" has misleading characters and might be confused with something else.
|
||||
|
||||
Reference in New Issue
Block a user