Retoor software development Projects Research SearchXNG
Register Sign In

16 lines
251 B
Plaintext
Raw Normal View History

test: add test for lowercase class name reference inside class body Add a new test file `lowercase_name_inside_body.wren` that verifies a class can correctly reference its own lowercase name from both static and instance methods. The test ensures that `foo` resolves to the class itself in static context and to the instance method `foo` in instance context, addressing issue #251.
2015-04-25 19:47:55 +02:00
class foo {
static callFoo {
IO.print(foo)
}
callFoo {
IO.print(foo)
}
foo { "instance foo method" }
static foo { "static foo method" }
}
foo.callFoo // expect: static foo method
feat: replace `new` keyword with `this` constructor syntax and `ClassName.new()` calls across core library and docs Replace all uses of the `new` reserved word with explicit `this new()` constructor definitions and `ClassName.new()` instantiation calls in builtin/core.wren. Update all documentation files (classes.markdown, fiber.markdown, fn.markdown, sequence.markdown, error-handling.markdown, expressions.markdown, fibers.markdown, functions.markdown) to reflect the new constructor syntax, removing `new` keyword examples and replacing them with `ClassName.new()` patterns and `this new()` definitions.
2015-07-10 18:18:22 +02:00
foo.new().callFoo // expect: instance foo method
Reference in New Issue Copy Permalink
ef721ee355
wren/test/language/class/lowercase_name_inside_body.wren
Response time: 44ms
Mail Licenses API