Re: toString/equals/hashCode implemented using method handles

2018-06-21 Thread forax
yes, the meta-protocols used are not the same (currently ?), - For records, the BSM is called with an array of method handles because a record defined an order (the order of the primary constructor) - For value type, the BSM doesn't use any supplementary constants (yet ?) Note that means that

Re: toString/equals/hashCode implemented using method handles

2018-06-21 Thread Brian Goetz
As discussed during our today meeting, here is an implementation of toString, equals and hashCode that can be used as default implementation of these methods for value types. There is also similar code in the Amber repo for records.  At some point, we should have a bake-off and pick the