为什么不只使用地图委托?class MyData(val map: Map<String, String>) { val foo by map val bar by map}或者您可以使用伴随对象包装它并使用 MyData.from(mymap)data class MyData(val foo: String, val bar: String) { companion object { fun from(map: Map<String, String>) = object { val foo by map val bar by map val data = MyData(foo, bar) }.data }