Skip to content

Commit 3e773b9

Browse files
committed
Merge pull request #89484 from dalexeev/update-gds-doc
Update `@GDScript` documentation
2 parents 25d913f + 0c48845 commit 3e773b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/gdscript/doc_classes/@GDScript.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check.
4444
assert(speed < 20, "the speed limit is 20") # Show a message.
4545
[/codeblock]
46+
[b]Note:[/b] [method assert] is a keyword, not a function. So you cannot access it as a [Callable] or use it inside expressions.
4647
</description>
4748
</method>
4849
<method name="char">
@@ -131,7 +132,7 @@
131132
- A constant from the [enum Variant.Type] enumeration, for example [constant TYPE_INT].
132133
- An [Object]-derived class which exists in [ClassDB], for example [Node].
133134
- A [Script] (you can use any class, including inner one).
134-
Unlike the right operand of the [code]is[/code] operator, [param type] can be a non-constant value. The [code]is[/code] operator supports more features (such as typed arrays) and is more performant. Use the operator instead of this method if you do not need dynamic type checking.
135+
Unlike the right operand of the [code]is[/code] operator, [param type] can be a non-constant value. The [code]is[/code] operator supports more features (such as typed arrays). Use the operator instead of this method if you do not need dynamic type checking.
135136
Examples:
136137
[codeblock]
137138
print(is_instance_of(a, TYPE_INT))
@@ -183,6 +184,7 @@
183184
# Create instance of a scene.
184185
var diamond = preload("res://diamond.tscn").instantiate()
185186
[/codeblock]
187+
[b]Note:[/b] [method preload] is a keyword, not a function. So you cannot access it as a [Callable].
186188
</description>
187189
</method>
188190
<method name="print_debug" qualifiers="vararg">
@@ -717,6 +719,8 @@
717719
<return type="void" />
718720
<description>
719721
Make a script with static variables to not persist after all references are lost. If the script is loaded again the static variables will revert to their default values.
722+
[b]Note:[/b] As annotations describe their subject, the [annotation @static_unload] annotation must be placed before the class definition and inheritance.
723+
[b]Warning:[/b] Currently, due to a bug, scripts are never freed, even if [annotation @static_unload] annotation is used.
720724
</description>
721725
</annotation>
722726
<annotation name="@tool">

0 commit comments

Comments
 (0)