Skip to content

Conversation

@kpumuk
Copy link
Contributor

@kpumuk kpumuk commented Nov 25, 2025

For aliased types, UUID constants retain their curly braces, while direct UUID constants do not:

typedef uuid myUUID

const uuid GEN_UUID =  '00000000-4444-CCCC-ffff-0123456789ab'
const uuid GEN_GUID = '{00112233-4455-6677-8899-aaBBccDDeeFF}'
const myUUID MY_UUID =  '00000000-4444-CCCC-ffff-0123456789ab'
const myUUID MY_GUID = '{00112233-4455-6677-8899-aaBBccDDeeFF}'

When uuid is compiled, it produces a string without curly braces, but for alias myUUID the curly braces stay:

GEN_UUID = %q"00000000-4444-CCCC-ffff-0123456789ab"
GEN_GUID = %q"00112233-4455-6677-8899-aaBBccDDeeFF"
MY_UUID = %q"00000000-4444-CCCC-ffff-0123456789ab"
MY_GUID = %q"{00112233-4455-6677-8899-aaBBccDDeeFF}"

This change ensures that the type is properly resolved to its true type before validation, resulting in consistent handling of UUID constants regardless of whether they are defined using the base type or an alias.

After:

GEN_UUID = %q"00000000-4444-CCCC-ffff-0123456789ab"
GEN_GUID = %q"00112233-4455-6677-8899-aaBBccDDeeFF"
MY_UUID = %q"00000000-4444-CCCC-ffff-0123456789ab"
MY_GUID = %q"00112233-4455-6677-8899-aaBBccDDeeFF"
  • Did you create an Apache Jira ticket? THRIFT-5911
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

For aliased types, UUID constants retain their curly braces, while
direct UUID constants do not:

    typedef uuid myUUID
    const uuid GEN_UUID =  '00000000-4444-CCCC-ffff-0123456789ab'
    const uuid GEN_GUID = '{00112233-4455-6677-8899-aaBBccDDeeFF}'
    const myUUID MY_UUID =  '00000000-4444-CCCC-ffff-0123456789ab'
    const myUUID MY_GUID = '{00112233-4455-6677-8899-aaBBccDDeeFF}'

When uuid is compiled, it produces a string without curly braces, but
for alias myUUID the curly braces stay:

    GEN_UUID = %q"00000000-4444-CCCC-ffff-0123456789ab"
    GEN_GUID = %q"00112233-4455-6677-8899-aaBBccDDeeFF"
    MY_UUID = %q"00000000-4444-CCCC-ffff-0123456789ab"
    MY_GUID = %q"{00112233-4455-6677-8899-aaBBccDDeeFF}"

This change ensures that the type is properly resolved to its true type
before validation, resulting in consistent handling of UUID constants
regardless of whether they are defined using the base type or an alias.
@Jens-G Jens-G merged commit 56f9772 into apache:master Dec 10, 2025
29 of 30 checks passed
@kpumuk kpumuk deleted the guid branch December 14, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants