[
https://issues.apache.org/jira/browse/THRIFT-2916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14547741#comment-14547741
]
ASF GitHub Bot commented on THRIFT-2916:
----------------------------------------
GitHub user phongphan opened a pull request:
https://github.com/apache/thrift/pull/503
THRIFT-2916 Add default toHash method to 'class' and 'struct'.
D's associative array requires "toHash" implementation if opEquals was
provided.
And both method should be consistent as stated in the
[documentation](http://dlang.org/hash-map.html).
> The toHash should consistently be the same value when opEquals returns
true.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/phongphan/thrift THRIFT-2916
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/503.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #503
----
commit 15b9c57c80820b4bdbeaab7a6d71e1782b78c5eb
Author: Phongphan Phuttha <[email protected]>
Date: 2015-05-18T08:18:17Z
THRIFT-2916 Add default toHash method to 'class' and 'struct' to meet D's
associative arrays requirement.
----
> make check fails for D language
> -------------------------------
>
> Key: THRIFT-2916
> URL: https://issues.apache.org/jira/browse/THRIFT-2916
> Project: Thrift
> Issue Type: Bug
> Components: D - Library
> Environment: openSUSE 13.2
> DMD32 D Compiler v2.066.1
> Reporter: Jens Geyer
>
> make check fails for D language with multiple error messages:
> {code}
> dmd -w -wi -O -release -inline -I../../../lib/d/src -Igen-d
> ../../../lib/d/libthriftd.a -ofserialization_benchmark
> serialization_benchmark.d gen-d/DebugProtoTest_types.d
> ../../../lib/d/src/thrift/util/hashset.d(120): Error: AA key type Empty
> should have 'size_t toHash() const nothrow @safe' if opEquals defined
> gen-d/DebugProtoTest_types.d(218): Error: template instance
> thrift.util.hashset.HashSet!(Empty) error instantiating
> ../../../lib/d/src/thrift/codegen/base.d-mixin-544(736): Error: undefined
> identifier meta
> ../../../lib/d/src/thrift/codegen/base.d-mixin-544(736): Error: static assert
> __error
> ../../../lib/d/src/thrift/codegen/base.d(371): instantiated from here:
> TIsSetFlags!(CompactProtoTestStruct, [TFieldMeta("a_byte", cast(short)1,
> cast(TReq)1, null), TFieldMeta("a_i16", cast(short)2, cast(TReq)1, null),
> TFieldMeta("a_i32", cast(short)3, cast(TReq)1, null), TFieldMeta("a_i64",
> cast(short)4, cast(TReq)1, null), TFieldMeta("a_double", cast(short)5,
> cast(TReq)1, null), TFieldMeta("a_string", cast(short)6, cast(TReq)1, null),
> TFieldMeta("a_binary", cast(short)7, cast(TReq)1, null),
> TFieldMeta("true_field", cast(short)8, cast(TReq)1, null),
> TFieldMeta("false_field", cast(short)9, cast(TReq)1, null),
> TFieldMeta("empty_struct_field", cast(short)10, cast(TReq)1, null),
> TFieldMeta("byte_list", cast(short)11, cast(TReq)1, null),
> TFieldMeta("i16_list", cast(short)12, cast(TReq)1, null),
> TFieldMeta("i32_list", cast(short)13, cast(TReq)1, null),
> TFieldMeta("i64_list", cast(short)14, cast(TReq)1, null),
> TFieldMeta("double_list", cast(short)15, cast(TReq)1, null),
> TFieldMeta("string_list", cast(short)16, cast(TReq)1, null),
> TFieldMeta("binary_list", cast(short)17, cast(TReq)1, null),
> TFieldMeta("boolean_list", cast(short)18, cast(TReq)1, null),
> TFieldMeta("struct_list", cast(short)19, cast(TReq)1, null),
> TFieldMeta("byte_set", cast(short)20, cast(TReq)1, null),
> TFieldMeta("i16_set", cast(short)21, cast(TReq)1, null),
> TFieldMeta("i32_set", cast(short)22, cast(TReq)1, null),
> TFieldMeta("i64_set", cast(short)23, cast(TReq)1, null),
> TFieldMeta("double_set", cast(short)24, cast(TReq)1, null),
> TFieldMeta("string_set", cast(short)25, cast(TReq)1, null),
> TFieldMeta("binary_set", cast(short)26, cast(TReq)1, null),
> TFieldMeta("boolean_set", cast(short)27, cast(TReq)1, null),
> TFieldMeta("struct_set", cast(short)28, cast(TReq)1, null),
> TFieldMeta("byte_byte_map", cast(short)29, cast(TReq)1, null),
> TFieldMeta("i16_byte_map", cast(short)30, cast(TReq)1, null),
> TFieldMeta("i32_byte_map", cast(short)31, cast(TReq)1, null),
> TFieldMeta("i64_byte_map", cast(short)32, cast(TReq)1, null),
> TFieldMeta("double_byte_map", cast(short)33, cast(TReq)1, null),
> TFieldMeta("string_byte_map", cast(short)34, cast(TReq)1, null),
> TFieldMeta("binary_byte_map", cast(short)35, cast(TReq)1, null),
> TFieldMeta("boolean_byte_map", cast(short)36, cast(TReq)1, null),
> TFieldMeta("byte_i16_map", cast(short)37, cast(TReq)1, null),
> TFieldMeta("byte_i32_map", cast(short)38, cast(TReq)1, null),
> TFieldMeta("byte_i64_map", cast(short)39, cast(TReq)1, null),
> TFieldMeta("byte_double_map", cast(short)40, cast(TReq)1, null),
> TFieldMeta("byte_string_map", cast(short)41, cast(TReq)1, null),
> TFieldMeta("byte_binary_map", cast(short)42, cast(TReq)1, null),
> TFieldMeta("byte_boolean_map", cast(short)43, cast(TReq)1, null),
> TFieldMeta("list_byte_map", cast(short)44, cast(TReq)1, null),
> TFieldMeta("set_byte_map", cast(short)45, cast(TReq)1, null),
> TFieldMeta("map_byte_map", cast(short)46, cast(TReq)1, null),
> TFieldMeta("byte_map_map", cast(short)47, cast(TReq)1, null),
> TFieldMeta("byte_set_map", cast(short)48, cast(TReq)1, null),
> TFieldMeta("byte_list_map", cast(short)49, cast(TReq)1, null)])
> Makefile:727: recipe for target 'serialization_benchmark' failed
> make[2]: *** [serialization_benchmark] Error 1
> make[2]: Leaving directory '/home/jens/Arbeitsfläche/Thrift/haxe/lib/d/test'
> Makefile:594: recipe for target 'check-am' failed
> make[1]: *** [check-am] Error 2
> make[1]: Leaving directory '/home/jens/Arbeitsfläche/Thrift/haxe/lib/d/test'
> Makefile:835: recipe for target 'check-recursive' failed
> make: *** [check-recursive] Error 1
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)