Skip to content

Lambda parameters get an extra "," at the end, causing syntax errors (v0.23.0) #301

Description

@blabdouze

If for exemple I want to use a lambda as argument, let's say for filter function :

func _my_func() -> void:
	[0, 2, 3].filter(
		func(value: int):
			match value:
				0:
					return false
				_:
					return true
	)

It will be formated as :

func _my_func() -> void:
	[0, 2, 3].filter(
		func(value: int):
			match value:
				0:
					return false
				_:
					return true,
	)

Notice the extra , added by the formater after return true causing a syntax error.

Same code is correctly formated on 0.21.0.

Related to #287 I think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions