Skip to content

Incorrect line number in "no such constant" error #323

@erkyrath

Description

@erkyrath

In this example:

[ Main; func(); ];

Object obj
  with before [;
	Frotz: return 1;    ! line 5
  ];

[ func;
	return Frotz;    ! line 9
];

Verb 'frotz' * -> Frotz;
[ FrotzSub; ];

...we get this error:

line 5: Error: No such constant as "Frotz"

The error is correct but the line number is not. Line 5 is a correct use of the ##Frotz action constant. It's line 9 that's wrong.

This only seems to occur when a switch-style use of the action constant (without ##) occurs before the erroneous symbol use. If I change the before property to

  with before [;
	if (sw__var == ##Frotz) return 1;
  ];

...then the error is correctly reported.

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