Skip to content

Remove soft return types - #123496

Open
HolonProduction wants to merge 1 commit into
godotengine:masterfrom
HolonProduction:cross-function-soft-types
Open

HolonProduction wants to merge 1 commit into
godotengine:masterfrom
HolonProduction:cross-function-soft-types

Conversation

@HolonProduction

@HolonProduction HolonProduction commented Sep 14, 2026

Copy link
Copy Markdown
Member

What problem(s) does this PR solve?

The above PR did check for soft return types in places that were consistently effected by them.
This PR completely removes soft types from return types, this is more risky than the above change and is bound to change behavior of some warnings. I'd hope to get this in early for 4.9.

However everything effected by this PR was previously dependent on function order (see the timing explanation from #121322 (comment)), which is why I don't consider this an issue. In addition the soft type deduction was bugged anyway which makes those warning not very reliable in the first place (only taking the last return statement into consideration).

Additional information

Here's an example were behaviour changes:

func a():
	return 2

func b():
	var _c = a() / 1 # This did previously emit an integer division warning. It now doesn't.

However

func b():
	var _c = a() / 1 # This did previously not emit a warning. Only the function order changed.

func a():
	return 2

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.

1 participant