theapache64 / retrosheet

📃 Turn Google Spreadsheet to JSON endpoint (for Android and JVM) for FREE (100%)
Apache License 2.0
881 stars 39 forks source link

Correct suspend function which returns array #16

Closed tuanchauict closed 3 years ago

tuanchauict commented 3 years ago

In #12, I was wrong when checking the return value is an array. Class.forName("className") does not return an Array class (class.isArray is always false). With this PR, I try to fix this by checking whether actualTypeArguments.firstOrNull().typeName ends with [].

Besides, I also update the code for checking Continuation in the return type. Instead of checking from typeName string, we can make it more reliable by comparing it with lastParameter.rawType.typeName.