Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Value is not set for a constant if it's defined as the value of another constant. #366

Open
WoodyGuo opened this issue May 16, 2018 · 1 comment
Labels

Comments

@WoodyGuo
Copy link

WoodyGuo commented May 16, 2018

In the following IDL file, there are 4 constants defined: days_7, days_14, days_30, and days_default.
The days_default and the days_30 are having the same value.

`interface_xxx = interface +c {

const days_7: i8 = 7;
const days_14: i8 = 14;
const days_30: i8 = 30;
const days_default: i8 = days_30;

}`

Compilation will fail after generating the code using the IDL file above, complaining with error "declaration of constexpr static data member 'DAYS_DEFAULT' requires an initializer".

Contents of the header and implementations files generated are listed below:

`
// interface_xxx.h
class InterfaceXxx {
public:
virtual ~InterfaceXxx() {}

static constexpr int8_t DAYS_7 = 7;
static constexpr int8_t DAYS_14 = 14;
static constexpr int8_t DAYS_30 = 30;
static constexpr int8_t DAYS_DEFAULT;
}`

`
// interface_xxx.cc
namespace ns {

int8_t const InterfaceXxx::DAYS_7;
int8_t const InterfaceXxx::DAYS_14;
int8_t const InterfaceXxx::DAYS_30;
int8_t const InterfaceXxx::DAYS_DEFAULT;

}`

WoodyGuo referenced this issue May 16, 2018
* Update parameter names in documentation

Because parameter names may not be written in the same format between
C++, Objective-C, and Java, it is impossible to have doxygen- or
javadoc-style @param annotations that match for all languages. This
change simply looks for "@param <PARAMNAME>" in the docstring and
rewrites it the same way as the sourcecode does.

* Replace all occurrences of parameter name in docstring

* Also update Java for static methods

* Add multi-word parameter name to test suite

And reference it from the docstring.

* Revert "Add multi-word parameter name to test suite"

This reverts commit 785a226.

* Add multi-word parameter name to test suite

And reference it from the docstring.
@artwyman
Copy link
Contributor

Note from prior discussion elsewhere: Looks likely to have been introduced by #354

@artwyman artwyman added the bug label Jun 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants