Throw an error if duplicate service methods are found in a service thrift spec
Throw an error if duplicate service methods are found in a service thrift spec

Summary:
Our thrift compiler does not check to see if a Thrift specification for a service defines a function more than once.

This leads to two known issues so far:
1) The Thrift file cannot be imported into Hack; a fatal about duplicate class names (because Thrift->Hack makes classes per function) will be thrown.
2) The generated Python code actually fails flake8 linting, stating that methods are being redefined.

Assumptions being made:
1) Even if we allowed different signatures (ie, overloading) in Thrift, Hack and Python don't support it. Thus allowing duplicate function names makes no sense (and diff commentary states that the wire protocol doesn't support duplicate function names anyway).
2) The behaviour of the Python client is semi-undefined. At the moment, Python seems to use the last method in the generated file, but this could change in a future release of python to be a hard error.
3) It's confusing for a human. Search a Thrift spec, find two functions with the same signature but different returns - which one is the right one?

This diff implements a check on the function that adds new service t_function structs to the vector of discovered functions. If the inbound structure's get_name() matches an existing element's get_name(), throw a runtime error.

Reviewed By: jesboat

Differential Revision: D3689974

fbshipit-source-id: 9d330f1861c5d1d29345429799c6b59347f42b05

getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,getyourguide/fbthrift,facebook/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,facebook/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift