E4091

E4091#

该类型没有具有给定名称的字段。

您可能输入了错误的字段名称来访问结构体的字段。

错误示例#

struct Point {
  x : Double
  y : Double
}

fn main {
  let point = Point::{ x : 1.0, y : 2.0 }
  println(point.z) // Error: The type Point has no field z.
}

建议#

You can either add the missing field to the struct, or use an existing field to access the struct.

struct Point {
  x : Double
  y : Double
}

fn main {
  let point = Point::{ x : 1.0, y : 2.0 }
  println(point.x)
  println(point.y)
}