Why nested class is not allowed in local class

This doesn’t work:

fun main() {
  class A {
    class B // why compiler error here?
  }
}

But other cases below work:

class A {
  class B
}
fun main() {
  class A {
    inner class B
  }
}