Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-4499) and (PUP-4500) Issues with TypeCalculator.common_type and String #3881

Merged
merged 3 commits into from
May 4, 2015

Conversation

thallgren
Copy link
Contributor

This PR fixes two problems with the TypeCalculator.common_type when used to compute the common type for two PStringType instances. I chose to put them in the same PR since they touches on the exact same lines of code which inevitably would cause merge conflicts.

The type calculator incorrectly assumes that the size_type of two PStringType
instances should be dropped when computing a common type. This commit changes
this so that the size_type will be the common type of the size_types of the
given string types provided that both have a size_type defined.
…values

Two String types that are not assignable in any direction, where one of the
types have a set of values defined but the other one doesn't will yield a
common type where values is equal to the set of the former. This commit
ensures that the values set is empty if one of the given types have an
empty set of values.
@puppetcla
Copy link

CLA signed by all contributors.

@melissa melissa added the PL label Apr 30, 2015
hlindberg added a commit that referenced this pull request May 4, 2015
(PUP-4499) and (PUP-4500) Issues with TypeCalculator.common_type and String
@hlindberg hlindberg merged commit 8eec99e into puppetlabs:3.x May 4, 2015
@thallgren thallgren deleted the issue/pup-4499-and-pup-4500 branch July 7, 2015 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants