Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: export var type reduce() implemented #36927

Merged

Conversation

ThakeeNathees
Copy link
Contributor

Fix: #36899

when exporting a var the parser checks if the type is supported and for array and dictionary, they are supported but if they contain any variant which doesn't supported -> BUG!!
setting an unsupported type value and saving the scene will also write invalid text to *.tscn file which will leads to an error Error while parsing *.tscn

## *.tscn file
dictionary = {
0: SubResource( 1 ), ## some value assigned from inspector
1: Object(GDScriptNativeClass,"script":null) ## no value assigned -> writing invalid text
}

fix: validate type recursively (for array and dictionary) to ensure that all types inside are supported.

export var type reduce

@ThakeeNathees ThakeeNathees force-pushed the export-var-type-reduce-implimented branch 4 times, most recently from 8e772ea to 0e9dc84 Compare March 9, 2020 00:13
@YeldhamDev YeldhamDev added bug cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:gdscript labels Mar 9, 2020
@YeldhamDev YeldhamDev added this to the 4.0 milestone Mar 9, 2020
@ThakeeNathees ThakeeNathees force-pushed the export-var-type-reduce-implimented branch from 0e9dc84 to 2da1c95 Compare March 10, 2020 13:12
modules/gdscript/gdscript_parser.cpp Outdated Show resolved Hide resolved
@ThakeeNathees ThakeeNathees force-pushed the export-var-type-reduce-implimented branch 3 times, most recently from 45ae2da to e621940 Compare April 27, 2020 13:52
@ThakeeNathees ThakeeNathees force-pushed the export-var-type-reduce-implimented branch from e621940 to cd48720 Compare April 27, 2020 13:57
@ThakeeNathees ThakeeNathees requested a review from vnen April 27, 2020 14:01
@akien-mga akien-mga merged commit f61587b into godotengine:master Apr 27, 2020
@akien-mga
Copy link
Member

Thanks!

@ThakeeNathees ThakeeNathees deleted the export-var-type-reduce-implimented branch April 27, 2020 15:17
@akien-mga
Copy link
Member

Cherry-picked for 3.2.2.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dictionary of References export breaks compilation
4 participants