MMTMMT Docs
Diagnostics

L004

struct nesting limit exceeded

L004

Records are nested more deeply than allowed. Flatten the shape or replace deep nesting with IDs.

Failing example

script "example"
type Level0 { next: Level1 }
type Level1 { next: Level2 }
type Level2 { next: Level3 }
type Level3 { next: Level4 }
type Level4 { next: Level5 }
type Level5 { next: Level6 }
type Level6 { next: Level7 }
type Level7 { next: Level8 }
type Level8 { next: Level9 }
type Level9 { next: Level10 }
type Level10 { next: Level11 }
type Level11 { next: Level12 }
type Level12 { next: Level13 }
type Level13 { next: Level14 }
type Level14 { next: Level15 }
type Level15 { next: Level16 }
type Level16 { next: Level17 }
type Level17 { value: int }

Corrected example

script "fixed"
type Inner { value: int }
type Outer { inner: Inner }

On this page