Skip to content

Ambiguous properties throw an exception #929

@ClementSparrow

Description

@ClementSparrow

This is a bug that Menderbug reported to me for Pattern:Script, but it occurs that it also happen in PuzzleScript in a slightly different form. When a property on the right-hand side of a rule is ambiguous, the rule is compiled further anyway and it causes an exception TypeError: z is undefined to be displayed in the console. Since in Pattern:Script the consequence is to throw instead an additional error message about the property not being assigned to a layer, I guess the exception is thrown in RulesToMask when accessing the layer.

Here is a minimal code to reproduce the issue:

OBJECTS

Background
black

Player
blue

A
green

B
red

LEGEND
C = A or B

SOUNDS
COLLISIONLAYERS

A 
B

RULES
right [ C | C | ] -> [ C | C | C ]

WINCONDITIONS
LEVELS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions