title: typescript: how do I overload a constructor?
body: <p>I am trying to overload a class constructor, but I don't seem to get the concept. I keep getting <code>overload signature is not compatible with function implementation</code></p>
  
  <p>This is what I'm looking at:</p>
  
  <pre><code>interface IGeoJson {
    type: string,
    coordinates: [number,number]
  }
  
  abstract class GeoJson implements IGeoJson {
  
    constructor (public type: string, public coordinates: [number,number]) {}
  
    toJson() : string {
      return JSON.stringify(this);
    }
  }
  
  class GeoJsonPoint extends GeoJson {
  
    /**
     * err: overload signature is not compatible with function implementation
     */
  //   constructor ( obj : IGeoJson);
    constructor ( obj : [number, number]) {
        let [longitude, latitude] = obj;
        if (longitude &amp;&amp; latitude) {
           super("Point", [longitude, latitude]);
        } 
        else {
          let {type, coordinates} = obj;
          if (type &amp;&amp; coordinates) {
              GeoJsonPoint.fromJson(obj);
          }
        }
    }
  
    static fromJson ( { type, coordinates } : IGeoJson) : GeoJsonPoint {
      if (type != 'Point') throw new Error("Error, expecting type=Point");
      let [longitude, latitude] = coordinates;
      return new GeoJsonPoint([longitude, latitude]);
    }
  }
  
  
  
  
  
  /**
   * runtime
   */
  
  let here = new GeoJsonPoint([10.123,20.456]);
  let hereAsJson = here.toJson();
  console.log('here:' + hereAsJson);
  
  
  let obj :IGeoJson = JSON.parse(hereAsJson);
  let hereFromJson = GeoJsonPoint.fromJson(obj);
  console.log('here From JSON.parse():' + hereFromJson.toJson())
  </code></pre>
  
  <p>I am trying to overload the constructor so I can do the following:</p>
  
  <pre><code>let obj = JSON.parse(hereAsJson);
  let hereFromOverloadedConstructor = new GeoJsonPoint(obj);
  console.log('here From overloaded constructor:' + hereFromOverloadedConstructor.toJson())
  </code></pre>