1

I read the following in the Nomicon:

Coercion is allowed between the following types:

Transitivity: T_1 to T_3 where T_1 coerces to T_2 and T_2 coerces to T_3.

I could not find an example which proves it. I can not think of two types that have no implicit coercion between them but there is a third type that has an implicit coercion between those two.

This is the first time I came across this great concept so I'd be glad to see a real example.

Community
  • 1
  • 1
vesii
  • 2,760
  • 4
  • 25
  • 71
  • Is `&&&&&&&&T` -> `&U` what you are looking for? – Shepmaster Mar 18 '19 at 18:04
  • @Shepmaster Ah, what does it mean? I'm lookin for a useful example. – vesii Mar 18 '19 at 18:29
  • 1
    Possible duplicate of [Why doesn't a nested reference to an array coerce to a slice?](https://stackoverflow.com/questions/47237733/why-doesnt-a-nested-reference-to-an-array-coerce-to-a-slice) tl;dr: it's not implemented. – trent Mar 18 '19 at 18:41

0 Answers0