HaxeFoundation / HaxeFoundation/haxe

How to create "something like haxe.PosInfos" yourself?

Open
#4,583 9 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

I would love to see the possibility of adding user-defined types like `haxe.PosInfos` that allow you to generate some value if none is provided.

It might look something like this:

`abstract Foo(String) {
public function new(s) this = s;
@:default macro static function make() {
return macro new Foo('foofoo');
}
}`

This is a silly example of course, but more complex macros could gather call site information and what not.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.