【发布时间】:2017-09-15 16:57:46
【问题描述】:
如果我编译这个:
class CsvFile(pathToFile : String)
{
init
{
if (!File(pathToFile).exists())
return
// Do something useful here
}
}
我收到一个错误:
错误:(18, 13) Kotlin: 'return' is not allowed here
我不想和编译器争论,但我很好奇这个限制背后的动机。
【问题讨论】:
标签: kotlin