Add support for default enum values that reference the original enum. #69

Merged
merged 1 commit into from Dec 20, 2014

Conversation

Projects
None yet
3 participants
@mikekap
Contributor

mikekap commented Dec 20, 2014

e.g. 1: PhoneType phone_type = PhoneType.MOBILE;

Add support for default enum values that reference the original enum.
e.g. 1: PhoneType phone_type = PhoneType.MOBILE;
@hit9

This comment has been minimized.

Show comment
Hide comment
@hit9

hit9 Dec 20, 2014

Contributor

LGTM

Contributor

hit9 commented Dec 20, 2014

LGTM

lxyu added a commit that referenced this pull request Dec 20, 2014

Merge pull request #69 from mikekap/develop
Add support for default enum values that reference the original enum.

@lxyu lxyu merged commit 5576c38 into eleme:develop Dec 20, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@lxyu

This comment has been minimized.

Show comment
Hide comment
@lxyu

lxyu Dec 20, 2014

Contributor

Thanks!

Contributor

lxyu commented Dec 20, 2014

Thanks!

@hit9

This comment has been minimized.

Show comment
Hide comment
@hit9

hit9 Jan 13, 2015

Contributor

@mikekap Is the following legal?

struct Person {
    1: string name,
    2: i32 age
    3: Country country = Country.US
}

enum Country {
    US = 1,
    UK = 2,
    CA = 3,
}

I mean when the referenced enum is defined after the referencer (here 'struct Person').

Contributor

hit9 commented Jan 13, 2015

@mikekap Is the following legal?

struct Person {
    1: string name,
    2: i32 age
    3: Country country = Country.US
}

enum Country {
    US = 1,
    UK = 2,
    CA = 3,
}

I mean when the referenced enum is defined after the referencer (here 'struct Person').

@hit9

This comment has been minimized.

Show comment
Hide comment
@hit9

hit9 Jan 13, 2015

Contributor

I have tested the following thrift file:

struct Person {
    1: Country country = Country.US
}

enum Country {
    US = 1
}

Apache thrift gives out:

[ERROR:/Users/hit9/spam/testth/hello.thrift:2] (last token was 'Country')
Type "Country" has not been defined.
Contributor

hit9 commented Jan 13, 2015

I have tested the following thrift file:

struct Person {
    1: Country country = Country.US
}

enum Country {
    US = 1
}

Apache thrift gives out:

[ERROR:/Users/hit9/spam/testth/hello.thrift:2] (last token was 'Country')
Type "Country" has not been defined.
@hit9

This comment has been minimized.

Show comment
Hide comment
@hit9

hit9 Jan 13, 2015

Contributor

So, we should replace the real value in the ply parsing progress.

Contributor

hit9 commented Jan 13, 2015

So, we should replace the real value in the ply parsing progress.

This was referenced Jan 13, 2015

@hit9 hit9 referenced this pull request Jan 23, 2015

Merged

New Parser #80

@hit9

This comment has been minimized.

Show comment
Hide comment
@hit9

hit9 Jan 24, 2015

Contributor

Parser has been rebuilt, but this feature was included.

Contributor

hit9 commented Jan 24, 2015

Parser has been rebuilt, but this feature was included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment