Verse Type Macro broken example

On a Type Macro page for Verse there is an example of how to extract type of function to use it in higher order function. This feature looks amazing and makes me thrill about the possibilities the language gives, but I can’t make it work in practice and looks like the behaviour was changed or not implemented yet.

Specifically, the first example is reported to be wrong by editor when I try to use it. Here is the example itself:

Foo() : int = 0
Bar(X : type{Foo()}) : type{Foo()} = X

And here is what Visual Studio Code reports when I’m pasting it into my custom device:

My initial naive idea was to remove function invocation which really makes some sense, but it leads to another issue:

If I correctly read it, it says that type macro only allows to read type of function declarations and not already declared funtions. I tried this out and it worked, but it’s not how documentation shows it:
image

Message was correctly printed in the game after I added device into the level, but it will be too verbose to do this for every function especially with more then none arguments :smiley:

Is here something wrong with me trying docs example or it’s not yet implemented in language as VS Code message says? And how could I work around this keeping it usable.

My UEFN version is Version: 5.1.1-25156858+++Fortnite+Release-24.20

VS Code: Version: 1.77.3 (user setup)
Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
Date: 2023-04-12T09:16:02.548Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: Yes

And thanks for all amazing work you’ve done on this, I’m astonished with how it works and I think you’ll push entire industry far with that :exploding_head:

2 Likes