pkl icon indicating copy to clipboard operation
pkl copied to clipboard

StackOverflowError with recursive validators

Open madisp opened this issue 4 months ago • 4 comments

Having two validators recurse into eachother blows up with a StackOverflowError. I don't really expect a fix here, but a better error message (e.g. what was currently being evaluated) would be nice.

PKL code:

class Link {
  operationRef: String?((this == null).xor(operationId == null))
  operationId: String?((this == null).xor(operationRef == null))
  parameters: Mapping<String, Any>
  requestBody: unknown?
  description: String?
  server: Server?
}

(I know I can omit the validator from operationId as the first one already covers it, initially I thought to add it to both just for some symmetry.)


Full stacktrace here: https://gist.github.com/madisp/f2d8f6edb50b9fccee15e17d87fa35a3

madisp avatar Feb 04 '24 01:02 madisp