-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: allow errors in inline structs
Consider the below example: #Step: (#Job & {opt: _}).opt #Job: matchN(1, [#NormalJob]) #NormalJob: { req!: int opt?: run?: string } The inline struct of field #Step is erroneous, as it does not satisfy the validator. However, V2 allowed accessing opt and bypass the error. This change allows this for V3 as well. One supportive argument for this choice is that V3 does allow selecting into an erroneous struct in this situation: #Step: #Job.opt #Job: matchN(1, [#NormalJob]) & {opt: _} #NormalJob: { req!: int opt?: run?: string } This is an equivalent situation. V3 should at least be consistent, so the choice was to make it more compatible with V2. This change does introduce a regression. We will address this in a subsequent CL. The two key fixes in this CL are the shallow evaluation in BinaryExpr (CompleteArcsOnly), which is what V2 did as well, and to pass the evaluation mode to evalArcTypes. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I5307445395574f649d0cd1c6d5b309de0a87ef58 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202907 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
7 changed files
with
147 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.