Klitos Kyriacou
04/15/2025, 3:54 PMevery {
constructedWith<MockCls>(OfTypeMatcher<String>(String::class)).add(2) // Mocks the constructor which takes a String
} returns 3
Why does OfTypeMatcher
need to have the type String
mentioned twice? If it was defined differently, we would be able to have just OfTypeMatcher<String>()
(if we used reified generics), or just OfTypeMatcher(String::class)
. Perhaps I've misunderstood its usage and the two String
type references don't have to be the same?