Ticket #22 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Some operators fail unexpectedly

Reported by: wolf <rowan@…> Owned by: mooneer
Priority: major Milestone:
Component: interpreter Version: 1.0a3
Keywords: Cc:

Description

Testcase:

class Test [
	operator add(value) [
		"success"|print;
	]
];

Test + 2;

Output:






System.exceptions.SyntaxError: syntax error, unexpected $end
  called from test-005.kt line 2

(The newlines *are* part of the output)

Expected:

success

Change History

comment:1 Changed 4 years ago by mooneer

  • Status changed from new to closed
  • Resolution set to invalid

The test case given above is incorrect. What it should be is this:

class Test [
	operator plus(value) [
		"success"|print;
	]
];

Test + 2;

(plus instead of add)

With that change, I do indeed get success when running it.

comment:2 Changed 4 years ago by wolf <rowan@…>

Ahh, right, one thing that needs fixing, the User Guide says division is an operator, but it's actually divide.

comment:3 Changed 4 years ago by mooneer

Documentation fixed in r251.

Note: See TracTickets for help on using tickets.