feat: add test for infix class expression after constructor call
Add a new test file `test/constructor/infix_class_expression.wren` that verifies the ability to use an infix operator on a freshly constructed object instance. The test creates a `Foo` class with a `+` method and checks that `new Foo + "value"` correctly evaluates to `"Foo value"`. Also includes a TODO comment noting other constructor expression patterns that should be tested.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
+ other { return "Foo " + other }
|
||||
}
|
||||
|
||||
io.write(new Foo + "value") // expect: Foo value
|
||||
|
||||
// TODO: Other expressions following a constructor, like new Foo.bar("arg").
|
||||
Reference in New Issue
Block a user