diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-09-03 20:23:27 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-09-06 17:12:43 +0200 |
commit | 8f5ffeeacc3ee5537f32a931f2d1ad566747ad9f (patch) | |
tree | 0057c238c611be2aa34cfcdd9c4ac3e26b76ef13 /editor/editor_run.h | |
parent | 750f8d4926edb14269d9f6a117c5a9fd4765373a (diff) |
Produce an error when a class has the same name as a Singleton
If you somehow end up with a Singleton.gd that looks like this:
extends Node
class_name Singleton
func foo():
pass
You will get an error when using it in another file:
extends Node2D
func _init():
# Parser Error: Non-static function "foo" can only be called from an instance.
Singleton.foo()
This error is confusing. This patch ensures that an error on the class_name line will be produced:
Parse Error: The class "Singleton" conflicts with the AutoLoad singleton of the same name, and is therefore redundant. Remove the class_name declaration to fix this error.
Fixes #28187.
Diffstat (limited to 'editor/editor_run.h')
0 files changed, 0 insertions, 0 deletions