E4028

E4028#

This expression has a type which is not a record.

Erroneous Example#

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

The example above tries to assign a record 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 record.

Suggestion#

Make sure to use the correct type instead:

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