X Tutup
Skip to content

Distinction between dot and colon syntax for methods #108

@dmarcuse

Description

@dmarcuse

Some Lua APIs provide objects with methods that must be invoked using dot syntax (thing.method(...)) as opposed to colon syntax (thing:method(...)). Having a custom decorator for this would be very useful.

Edit: This behavior already exists for namespaces, it just needs to be expanded for object-oriented use. I propose a new custom decorator, !DotMethod, applicable to declarations of classes, interfaces, type literals, and methods of any of these.

Example usages:

/** !DotMethod */
declare class SomethingExternal {
	doThing(): SomethingReturned;
}

/** !DotMethod */
interface SomethingReturned {
	doOtherThing(): void;
}

type SomethingElse = {
	/** !DotMethod **/
	dotMethod(): void,
	regularMethod(): void
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup