GDScript: Allow constant expressions in annotations
This commit is contained in:
+5
-5
@@ -20,26 +20,26 @@ func test_utility(v, f):
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_builtin_call(v, f):
|
||||
@warning_ignore(unsafe_method_access)
|
||||
@warning_ignore("unsafe_method_access")
|
||||
v.angle() # Built-in method call.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_builtin_call_validated(v: Vector2, f):
|
||||
@warning_ignore(return_value_discarded)
|
||||
@warning_ignore("return_value_discarded")
|
||||
v.abs() # Built-in method call validated.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_object_call(v, f):
|
||||
@warning_ignore(unsafe_method_access)
|
||||
@warning_ignore("unsafe_method_access")
|
||||
v.get_reference_count() # Native type method call.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_object_call_method_bind(v: Resource, f):
|
||||
@warning_ignore(return_value_discarded)
|
||||
@warning_ignore("return_value_discarded")
|
||||
v.duplicate() # Native type method call with MethodBind.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
func test_object_call_ptrcall(v: RefCounted, f):
|
||||
@warning_ignore(return_value_discarded)
|
||||
@warning_ignore("return_value_discarded")
|
||||
v.get_reference_count() # Native type method call with ptrcall.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
Reference in New Issue
Block a user