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

Permit implictly unwrapped optionals when using @SceneTree #137

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

PadraigK
Copy link
Contributor

Since I know that I'm only going to reference these properties after they are available in _ready(), I prefer to implicitly unwrap the optional. At the moment a diagnostic warning prevents me from doing this. This PR loosens the requirement a bit so that we can use ! as well as ?. It will still emit a diagnostic if the type is missing both.

class MainScene: Node {
    @SceneTree(path: "StartPosition") var startPosition: Marker2D!
    @SceneTree(path: "Camera2D") var camera: Camera2D!
}

@migueldeicaza
Copy link
Owner

Thank you for the contribution!

@migueldeicaza migueldeicaza merged commit 39689af into migueldeicaza:main Sep 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants