Revert "GDScript: Add warnings that are set to error by default"

This reverts commit a166833bfa.

This caused multiple regressions.
Needs to be redone with more testing before merge.

Fixes #72501.
This commit is contained in:
Rémi Verschelde
2023-02-01 10:54:22 +01:00
parent f7397a5ac6
commit afe3b94ab2
18 changed files with 57 additions and 313 deletions

View File

@@ -1,2 +1,2 @@
GDTEST_ANALYZER_ERROR
The function signature doesn't match the parent. Parent signature is "my_function(int = <default>) -> int".
The function signature doesn't match the parent. Parent signature is "my_function(int = default) -> int".

View File

@@ -2,18 +2,16 @@ func variant() -> Variant: return null
var member_weak = variant()
var member_typed: Variant = variant()
@warning_ignore("inference_on_variant")
var member_inferred := variant()
func param_weak(param = variant()) -> void: print(param)
func param_typed(param: Variant = variant()) -> void: print(param)
@warning_ignore("inference_on_variant")
func param_inferred(param := variant()) -> void: print(param)
func return_untyped(): return variant()
func return_typed() -> Variant: return variant()
@warning_ignore("unused_variable", "inference_on_variant")
@warning_ignore("unused_variable")
func test() -> void:
var weak = variant()
var typed: Variant = variant()

View File

@@ -1,15 +0,0 @@
extends Node
var add_node = do_add_node() # Hack to have one node on init and not fail at runtime.
var shorthand = $Node
var with_self = self.get_node("Node")
var without_self = get_node("Node")
func test():
print("warn")
func do_add_node():
var node = Node.new()
node.name = "Node"
add_child(node)

View File

@@ -1,14 +0,0 @@
GDTEST_OK
>> WARNING
>> Line: 5
>> GET_NODE_DEFAULT_WITHOUT_ONREADY
>> The default value is using "$" which won't return nodes in the scene tree before "_ready()" is called. Use the "@onready" annotation to solve this.
>> WARNING
>> Line: 6
>> GET_NODE_DEFAULT_WITHOUT_ONREADY
>> The default value is using "get_node()" which won't return nodes in the scene tree before "_ready()" is called. Use the "@onready" annotation to solve this.
>> WARNING
>> Line: 7
>> GET_NODE_DEFAULT_WITHOUT_ONREADY
>> The default value is using "get_node()" which won't return nodes in the scene tree before "_ready()" is called. Use the "@onready" annotation to solve this.
warn

View File

@@ -1,6 +0,0 @@
func test():
var inferred_with_variant := return_variant()
print(inferred_with_variant)
func return_variant() -> Variant:
return "warn"

View File

@@ -1,6 +0,0 @@
GDTEST_OK
>> WARNING
>> Line: 2
>> INFERENCE_ON_VARIANT
>> The variable type is being inferred from a Variant value, so it will be typed as Variant.
warn

View File

@@ -1,6 +0,0 @@
extends Node
@onready @export var conflict = ""
func test():
print("warn")

View File

@@ -1,6 +0,0 @@
GDTEST_OK
>> WARNING
>> Line: 3
>> ONREADY_WITH_EXPORT
>> The "@onready" annotation will make the default value to be set after the "@export" takes effect and will override it.
warn

View File

@@ -1,5 +0,0 @@
func test():
print("warn")
func get(_property: StringName) -> Variant:
return null

View File

@@ -1,6 +0,0 @@
GDTEST_OK
>> WARNING
>> Line: 4
>> NATIVE_METHOD_OVERRIDE
>> The method "get" overrides a method from native class "Object". This won't be called by the engine and may not work as expected.
warn