Halt and catch fire: Difference between revisions

GDScript
(GDScript)
Line 229:
#define B() A()
A()</syntaxhighlight>
 
=={{header|GDScript}}==
An empty script will run and immediately error due to not inheriting from Node:
<code>Script inherits from native type 'RefCounted', so it can't be assigned to an object of type: 'Node'</code>
 
A script with zero warnings:
<syntaxhighlight lang="gdscript">
extends Node
func _init():$a.a()
</syntaxhighlight>
<pre>
E 0:00:00:0321 halt_and_catch_fire.gd:2 @ _init(): Node not found: "a" (relative to "Node").
<C++ Error> Method/function failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1364 @ get_node()
<Stack Trace> halt_and_catch_fire.gd:2 @ _init()
</pre>
 
This attempts to call a method on a nonexistent child node (just accessing without calling will produce a warning <code>Standalone expression (the line has no effect).</code>
 
=={{header|Go}}==
89

edits