{
  "type": "Program",
  "statements": [
    {
      "type": "TSDeclareFunction",
      "function": {
        "type": "ScriptFunction",
        "id": {
          "type": "Identifier",
          "name": "foo",
          "decorators": [],
          "loc": {
            "start": {
              "line": 1,
              "column": 10
            },
            "end": {
              "line": 1,
              "column": 13
            }
          }
        },
        "generator": false,
        "async": false,
        "expression": false,
        "params": [
          {
            "type": "Identifier",
            "name": "a",
            "typeAnnotation": {
              "type": "TSNumberKeyword",
              "loc": {
                "start": {
                  "line": 1,
                  "column": 17
                },
                "end": {
                  "line": 1,
                  "column": 23
                }
              }
            },
            "decorators": [],
            "loc": {
              "start": {
                "line": 1,
                "column": 14
              },
              "end": {
                "line": 1,
                "column": 15
              }
            }
          },
          {
            "type": "Identifier",
            "name": "b",
            "typeAnnotation": {
              "type": "TSStringKeyword",
              "loc": {
                "start": {
                  "line": 1,
                  "column": 29
                },
                "end": {
                  "line": 1,
                  "column": 35
                }
              }
            },
            "optional": true,
            "decorators": [],
            "loc": {
              "start": {
                "line": 1,
                "column": 25
              },
              "end": {
                "line": 1,
                "column": 26
              }
            }
          }
        ],
        "returnType": {
          "type": "TSNumberKeyword",
          "loc": {
            "start": {
              "line": 1,
              "column": 38
            },
            "end": {
              "line": 1,
              "column": 44
            }
          }
        },
        "loc": {
          "start": {
            "line": 1,
            "column": 1
          },
          "end": {
            "line": 1,
            "column": 45
          }
        }
      },
      "loc": {
        "start": {
          "line": 1,
          "column": 1
        },
        "end": {
          "line": 1,
          "column": 45
        }
      }
    },
    {
      "type": "TSDeclareFunction",
      "function": {
        "type": "ScriptFunction",
        "id": {
          "type": "Identifier",
          "name": "foo",
          "decorators": [],
          "loc": {
            "start": {
              "line": 2,
              "column": 10
            },
            "end": {
              "line": 2,
              "column": 13
            }
          }
        },
        "generator": false,
        "async": false,
        "expression": false,
        "params": [
          {
            "type": "Identifier",
            "name": "a",
            "typeAnnotation": {
              "type": "TSUnionType",
              "types": [
                {
                  "type": "TSStringKeyword",
                  "loc": {
                    "start": {
                      "line": 2,
                      "column": 17
                    },
                    "end": {
                      "line": 2,
                      "column": 23
                    }
                  }
                },
                {
                  "type": "TSNumberKeyword",
                  "loc": {
                    "start": {
                      "line": 2,
                      "column": 26
                    },
                    "end": {
                      "line": 2,
                      "column": 32
                    }
                  }
                }
              ],
              "loc": {
                "start": {
                  "line": 2,
                  "column": 17
                },
                "end": {
                  "line": 2,
                  "column": 32
                }
              }
            },
            "decorators": [],
            "loc": {
              "start": {
                "line": 2,
                "column": 14
              },
              "end": {
                "line": 2,
                "column": 15
              }
            }
          },
          {
            "type": "Identifier",
            "name": "b",
            "typeAnnotation": {
              "type": "TSStringKeyword",
              "loc": {
                "start": {
                  "line": 2,
                  "column": 37
                },
                "end": {
                  "line": 2,
                  "column": 43
                }
              }
            },
            "decorators": [],
            "loc": {
              "start": {
                "line": 2,
                "column": 34
              },
              "end": {
                "line": 2,
                "column": 35
              }
            }
          },
          {
            "type": "Identifier",
            "name": "c",
            "typeAnnotation": {
              "type": "TSNumberKeyword",
              "loc": {
                "start": {
                  "line": 2,
                  "column": 48
                },
                "end": {
                  "line": 2,
                  "column": 54
                }
              }
            },
            "decorators": [],
            "loc": {
              "start": {
                "line": 2,
                "column": 45
              },
              "end": {
                "line": 2,
                "column": 46
              }
            }
          }
        ],
        "returnType": {
          "type": "TSNumberKeyword",
          "loc": {
            "start": {
              "line": 2,
              "column": 57
            },
            "end": {
              "line": 2,
              "column": 63
            }
          }
        },
        "loc": {
          "start": {
            "line": 2,
            "column": 1
          },
          "end": {
            "line": 2,
            "column": 64
          }
        }
      },
      "loc": {
        "start": {
          "line": 2,
          "column": 1
        },
        "end": {
          "line": 2,
          "column": 64
        }
      }
    },
    {
      "type": "FunctionDeclaration",
      "function": {
        "type": "ScriptFunction",
        "id": {
          "type": "Identifier",
          "name": "foo",
          "decorators": [],
          "loc": {
            "start": {
              "line": 3,
              "column": 10
            },
            "end": {
              "line": 3,
              "column": 13
            }
          }
        },
        "generator": false,
        "async": false,
        "expression": false,
        "params": [
          {
            "type": "Identifier",
            "name": "a",
            "typeAnnotation": {
              "type": "TSUnionType",
              "types": [
                {
                  "type": "TSStringKeyword",
                  "loc": {
                    "start": {
                      "line": 3,
                      "column": 17
                    },
                    "end": {
                      "line": 3,
                      "column": 23
                    }
                  }
                },
                {
                  "type": "TSNumberKeyword",
                  "loc": {
                    "start": {
                      "line": 3,
                      "column": 26
                    },
                    "end": {
                      "line": 3,
                      "column": 32
                    }
                  }
                }
              ],
              "loc": {
                "start": {
                  "line": 3,
                  "column": 17
                },
                "end": {
                  "line": 3,
                  "column": 32
                }
              }
            },
            "decorators": [],
            "loc": {
              "start": {
                "line": 3,
                "column": 14
              },
              "end": {
                "line": 3,
                "column": 15
              }
            }
          },
          {
            "type": "Identifier",
            "name": "b",
            "typeAnnotation": {
              "type": "TSStringKeyword",
              "loc": {
                "start": {
                  "line": 3,
                  "column": 38
                },
                "end": {
                  "line": 3,
                  "column": 44
                }
              }
            },
            "optional": true,
            "decorators": [],
            "loc": {
              "start": {
                "line": 3,
                "column": 34
              },
              "end": {
                "line": 3,
                "column": 35
              }
            }
          },
          {
            "type": "Identifier",
            "name": "c",
            "typeAnnotation": {
              "type": "TSNumberKeyword",
              "loc": {
                "start": {
                  "line": 3,
                  "column": 50
                },
                "end": {
                  "line": 3,
                  "column": 56
                }
              }
            },
            "optional": true,
            "decorators": [],
            "loc": {
              "start": {
                "line": 3,
                "column": 46
              },
              "end": {
                "line": 3,
                "column": 47
              }
            }
          }
        ],
        "body": {
          "type": "BlockStatement",
          "statements": [
            {
              "type": "ReturnStatement",
              "argument": {
                "type": "NumberLiteral",
                "value": 12,
                "loc": {
                  "start": {
                    "line": 4,
                    "column": 12
                  },
                  "end": {
                    "line": 4,
                    "column": 14
                  }
                }
              },
              "loc": {
                "start": {
                  "line": 4,
                  "column": 5
                },
                "end": {
                  "line": 4,
                  "column": 15
                }
              }
            }
          ],
          "loc": {
            "start": {
              "line": 3,
              "column": 58
            },
            "end": {
              "line": 5,
              "column": 2
            }
          }
        },
        "loc": {
          "start": {
            "line": 3,
            "column": 1
          },
          "end": {
            "line": 5,
            "column": 2
          }
        }
      },
      "loc": {
        "start": {
          "line": 3,
          "column": 1
        },
        "end": {
          "line": 5,
          "column": 2
        }
      }
    },
    {
      "type": "VariableDeclaration",
      "declarations": [
        {
          "type": "VariableDeclarator",
          "id": {
            "type": "Identifier",
            "name": "a",
            "typeAnnotation": {
              "type": "TSStringKeyword",
              "loc": {
                "start": {
                  "line": 7,
                  "column": 8
                },
                "end": {
                  "line": 7,
                  "column": 14
                }
              }
            },
            "decorators": [],
            "loc": {
              "start": {
                "line": 7,
                "column": 5
              },
              "end": {
                "line": 7,
                "column": 6
              }
            }
          },
          "init": {
            "type": "CallExpression",
            "callee": {
              "type": "Identifier",
              "name": "foo",
              "decorators": [],
              "loc": {
                "start": {
                  "line": 7,
                  "column": 17
                },
                "end": {
                  "line": 7,
                  "column": 20
                }
              }
            },
            "arguments": [
              {
                "type": "NumberLiteral",
                "value": 2,
                "loc": {
                  "start": {
                    "line": 7,
                    "column": 21
                  },
                  "end": {
                    "line": 7,
                    "column": 22
                  }
                }
              }
            ],
            "optional": false,
            "loc": {
              "start": {
                "line": 7,
                "column": 17
              },
              "end": {
                "line": 7,
                "column": 23
              }
            }
          },
          "loc": {
            "start": {
              "line": 7,
              "column": 5
            },
            "end": {
              "line": 7,
              "column": 23
            }
          }
        }
      ],
      "kind": "var",
      "loc": {
        "start": {
          "line": 7,
          "column": 1
        },
        "end": {
          "line": 7,
          "column": 24
        }
      }
    }
  ],
  "loc": {
    "start": {
      "line": 1,
      "column": 1
    },
    "end": {
      "line": 7,
      "column": 24
    }
  }
}
TypeError: Type 'number' is not assignable to type 'string' [functionOverload4.ts:7:5]
