Languages which feature a structural type system have to handle deeply nested issues:

TypeScript


ts index.ts
type A = { a: { b: { c: { d: "hello" } } } }

let a: A = { a: { b: { c: { d: "hello" } } } }
let b = { a: { b: { c: { d: 123 } } } }

a = b

index.ts:6:1 - error TS2322: Type '{ a: { b: { c: { d: number; }; }; }; }' is not assignable to type 'A'.
  The types of 'a.b.c.d' are incompatible between these types.
    Type 'number' is not assignable to type '"hello"'.

6 a = b
  ~


Found 1 error.


Flow


ts index.js
/* @flow */
type A = { a: { b: { c: { d: "hello" } } } }

let a:A = { a: { b: { c: { d: "hello" } } } }
let b = { a: { b: { c: { d: 123 } } } }

a = b


                                                                                         
error Couldn't find a package.json file in "/tmp/flow/assignability"

                                                                                         
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.