E4093

E4093#

The type is not a struct type.

This error occurs when you try to construct a type that is not a struct using the T::{ .. } syntax.

Erroneous example#

///|
priv enum Point {
  D2(Double, Double)
  D3(Double, Double, Double)
}

///|
test {
  let a = Point::{ x: 1.0, y: 2.0 }
  //      ^~~~~
  // Error: The type Point is not a struct type
  ignore(a)
}

Suggestion#

You should use the correct syntax to construct the type.

///|
priv enum  {
  (, )
  (, , )
}

///|
test {
  let  = ::(1.0, 2.0)
  let  = ::(1.0, 2.0, 3.0)
  match  {
    (, ) => {
      (, ="1")
      (, ="2")
    }
    (_, _, _) => ("unexpected 3D point")
  }
  match  {
    (_, _) => ("unexpected 2D point")
    (, , ) => {
      (, ="1")
      (, ="2")
      (, ="3")
    }
  }
}