HomePhorge

(PUP-4483) Enable Struct keys to be NotUndef or Optional
79ffde796085Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-4483) Enable Struct keys to be NotUndef or Optional

Prior to this commit, a Struct key was a non empty string literal
and it's type was assumed to always be optional. A consequence of
this was that there was no way to describe a type that required
an entry where the key was required but the value was optional. In
short, there was no way to differntiate a "missing entry" from
"entry with undef value".

This commit changes this so that the key of a struct member is a
proper type. The type is restricted in that it must be possible to
infer a non-empty string from it (this becomes the former name of the
key).

The old behavior is preserved so that if a string literal is used as
a key, it will be converted to its corresponding String type. The
String will then be wrapped in an Optional type if the type of the
value is assignable from Undef.

Details

Provenance
Thomas Hallgren <thomas@tada.se>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU0feecfdc3250: (PUP-4483) Add NotUndef type to the Puppet type system
Branches
Unknown
Tags
Unknown

Event Timeline

Thomas Hallgren <thomas@tada.se> committed rPU79ffde796085: (PUP-4483) Enable Struct keys to be NotUndef or Optional (authored by Thomas Hallgren <thomas@tada.se>).May 5 2015, 3:06 PM