forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GDScript: Fix common mismatched external parser errors
- Loading branch information
1 parent
607b230
commit 6e8fa6d
Showing
15 changed files
with
225 additions
and
44 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/gdscript/tests/scripts/analyzer/errors/cyclic_ref_external.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
GDTEST_ANALYZER_ERROR | ||
Could not resolve member "v". | ||
Could not resolve external class member "v". |
17 changes: 17 additions & 0 deletions
17
modules/gdscript/tests/scripts/analyzer/features/external_parser.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extends "external_parser_base1.notest.gd" | ||
|
||
const External1 = preload("external_parser_script1.notest.gd") | ||
|
||
func baz(e1: External1) -> void: | ||
print(e1.e1c.bar) | ||
print(e1.baz) | ||
|
||
func test_external_base_parser_type_resolve(_v: TypeFromBase): | ||
pass | ||
|
||
func test(): | ||
var ext := External1.new() | ||
print(ext.array[0].test2) | ||
print(ext.get_external2().get_external3().test3) | ||
# TODO: This actually produces a runtime error, but we're testing the analyzer here | ||
#baz(ext) |
3 changes: 3 additions & 0 deletions
3
modules/gdscript/tests/scripts/analyzer/features/external_parser.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
GDTEST_OK | ||
test2 | ||
test3 |
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/analyzer/features/external_parser_base1.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extends "external_parser_base2.notest.gd" |
2 changes: 2 additions & 0 deletions
2
modules/gdscript/tests/scripts/analyzer/features/external_parser_base2.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class TypeFromBase: | ||
pass |
12 changes: 12 additions & 0 deletions
12
modules/gdscript/tests/scripts/analyzer/features/external_parser_script1.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extends "external_parser_script1_base.notest.gd" | ||
|
||
const External2 = preload("external_parser_script2.notest.gd") | ||
const External1c = preload("external_parser_script1c.notest.gd") | ||
|
||
@export var e1c: External1c | ||
|
||
var array: Array[External2] = [ External2.new() ] | ||
var baz: int | ||
|
||
func get_external2() -> External2: | ||
return External2.new() |
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/analyzer/features/external_parser_script1_base.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extends Resource |
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/analyzer/features/external_parser_script1c.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extends "external_parser_script1d.notest.gd" |
5 changes: 5 additions & 0 deletions
5
modules/gdscript/tests/scripts/analyzer/features/external_parser_script1d.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
extends "external_parser_script1f.notest.gd" | ||
|
||
const External1e = preload("external_parser_script1e.notest.gd") | ||
|
||
var bar: Array[External1e] |
Empty file.
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/analyzer/features/external_parser_script1f.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extends Resource |
6 changes: 6 additions & 0 deletions
6
modules/gdscript/tests/scripts/analyzer/features/external_parser_script2.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const External3 = preload("external_parser_script3.notest.gd") | ||
|
||
var test2 := "test2" | ||
|
||
func get_external3() -> External3: | ||
return External3.new() |
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/analyzer/features/external_parser_script3.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var test3 := "test3" |