VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Fortnite›Verse Language·Up to Fortnite · Verse Language·92 of 570 in Verse Language

Data Types in Verse

The type macro is a special Verse construct that can be used to define functions or construct new types from existing types using where clauses. The type macro can be used anywhere a type can be used. For example, the following example constructs a new type using a where clause, then uses that type in a function:

|  |  |
| --- | --- |
|  | # Construct a new type with a where clause |
|  | uint8 := type{X:int where 0 <= X, X < 256} |
|  |  |
|  | # Define a new function using uint8 |
|  | Foo():uint8 = 0 |

Construct a new type with a where clause

uint8 := type{X:int where 0 <= X, X < 256}

Define a new function using uint8

Foo():uint8 = 0

Copy full snippet(5 lines long)

There where clause is only supported in function parameter definitions or as a range condition on numeric types.

The following example uses the type macro to define a function as an argument to a new function:

|  |  |
| --- | --- |
|  | # Define a function with type |
|  | Bar(X:type{_():uint8}):uint8 = X() |
|  |  |
|  | # Call Bar with Foo argument |
|  | Y := Bar(Foo) |

Define a function with type

Bar(X:type{_():uint8}):uint8 = X()

Call Bar with Foo argument

Y := Bar(Foo)

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 92 of 570
Prev
type casting and conversion in verse
Next
types in verse
Browse all files in this folder (A–Z)

Source

Epic Games documentation

View original

Last updated 2026-03-08T05:11:13.273483+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse