Skip to content

Optional Default Expression does not account for multiple. #8079

@Absolutionism

Description

@Absolutionism

Skript/Server Version

dev/feature

Bug Description

When creating a SyntaxElement and including an optional multi-typed expression in the pattern ([%type1/type2%]) then having a defaultExpression for the ClassInfo of type2 but not for type1, SkriptParser fails to check if any of the types have a defaultExpression.
Resulting in a SkriptAPIException since type1 does not have a defaultExpression

Expected Behavior

To check if any of the types has a defaultExpression
As well as updated Exception messages if there are multiple types.

Steps to Reproduce

Find a SyntaxElement that intakes multiple types for 1 expression/spot.
Do not have a defaultExpression for the first type, and have one for second type.
If needed, make the expression in the pattern optional []
Use where necessary

Errors or Screenshots

Image

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions