Skip to content

–– Pkl Error –– Type alias definitions must not be cyclic #136

Answered by holzensp
Kieren asked this question in Q&A
Discussion options

You must be logged in to vote

Currently, this is a hard restriction. We've been thinking about adding elements and entries to Typed objects also. That might resolve this ask. One of the problems here is that Pkl is lazy, so you can very easily "tie the knot," i.e. embed an object in itself, creating an infinite nesting. For Pkl to resolve something is a class, it only needs to have the outer structure (that is to say, it doesn't have to evaluate all the properties). Deciding whether something is a AddressedTypeMapping<T> would require forcing the entire structure. If said structure contains such self-reference, that's a StackOverflow.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Kieren
Comment options

@bioball
Comment options

@Kieren
Comment options

Answer selected by Kieren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants