Summary: We model Enum.name as returing a constant name, rather than getting real field names. We did this because we couldn't think of any big gains, in terms of analysis precision/performance, from getting the real names. Reviewed By: ezgicicek Differential Revision: D21201730 fbshipit-source-id: a2dc01a44master
parent
7b6ddba689
commit
7bf7d24e4b
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum MyEnum {
|
||||||
|
MyEnum1,
|
||||||
|
MyEnum2,
|
||||||
|
}
|
||||||
|
|
||||||
|
class EnumTest {
|
||||||
|
void enum_name_constant(MyEnum e) {
|
||||||
|
for (int i = 0; i < e.name().length(); i++) {}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue