E4028

E4028#

This expression has a type which is not a struct.

Erroneous Example#

struct T { a : Int }
let a : Int = { a: 42 }

The example above tries to assign a struct of type T to a variable a of type Int, which is not possible and gives the following error on line 2:

This expression has type Int, which is a Int type and not a struct.

Suggestion#

Make sure to use the correct type instead:

struct T { a : Int }
let a : T = { a: 42 }