mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
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:
@@ -0,0 +1,6 @@
|
||||
# GH-73213
|
||||
|
||||
func test():
|
||||
var object := Object.new() # Not `Object()`.
|
||||
print(object.get_class())
|
||||
object.free()
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_OK
|
||||
Object
|
||||
@@ -12,6 +12,7 @@ func test():
|
||||
print("end")
|
||||
|
||||
func test_construct(v, f):
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
Vector2(v, v) # Built-in type construct.
|
||||
assert(not f) # Test unary operator reading from `nil`.
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ func test():
|
||||
|
||||
@warning_ignore("unsafe_method_access")
|
||||
var path = get_script().get_path().get_base_dir()
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
var other = load(path + "/static_variables_load.gd")
|
||||
|
||||
prints("load.perm:", other.perm)
|
||||
|
||||
@@ -24,7 +24,8 @@ func test():
|
||||
print(StringName("hello"))
|
||||
print(NodePath("hello/world"))
|
||||
var node := Node.new()
|
||||
print(RID(node))
|
||||
@warning_ignore("unsafe_call_argument")
|
||||
print(RID(node)) # TODO: Why is the constructor (or implicit cast) not documented?
|
||||
print(node.get_name)
|
||||
print(node.property_list_changed)
|
||||
node.free()
|
||||
|
||||
Reference in New Issue
Block a user