You have come across a very rare case of syntactic ambiguity. I think this is the first for SO, congratulations!
Your original syntax is technically correct, but in this context it can also be interpreted as an attempt to call c.boy<A,B> . Since the compiler did not know what you had in mind, it suggested that you need a function call.
The simplest fix is ββto add parentheses as you did, or reorder the expressions:
girl(c.boy < A, A < B)
PS The same thing can happen in C #, so it is not unique to Kotlin
source share