The expression form { expr with . } may only be used with record types. To build object types use { new Type(.) with . } ...