var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var GenericDemo;
(function (GenericDemo) {
    (function (Geschlecht) {
        Geschlecht[Geschlecht["maennlich"] = 0] = "maennlich";
        Geschlecht[Geschlecht["weiblich"] = 1] = "weiblich";
    })(GenericDemo.Geschlecht || (GenericDemo.Geschlecht = {}));
    var Geschlecht = GenericDemo.Geschlecht;
    var Person = (function () {
        function Person(name) {
            this.name = name;
        }
        return Person;
    }());
    GenericDemo.Person = Person;
    var Mann = (function (_super) {
        __extends(Mann, _super);
        function Mann(name) {
            _super.call(this, name);
            this.geschlecht = Geschlecht.maennlich;
        }
        return Mann;
    }(Person));
    GenericDemo.Mann = Mann;
    var Frau = (function (_super) {
        __extends(Frau, _super);
        function Frau(name) {
            _super.call(this, name);
            this.geschlecht = Geschlecht.weiblich;
        }
        return Frau;
    }(Person));
    GenericDemo.Frau = Frau;
    var Ehepaar = (function () {
        function Ehepaar(Person1, Person2) {
            this.Person1 = Person1;
            this.Person2 = Person2;
        }
        Ehepaar.prototype.print = function () {
            var typename1 = this.Person1 instanceof Mann ? "Mann" : "Frau";
            var typename2 = this.Person2 instanceof Mann ? "Mann" : "Frau";
            ausgabe(typename1 + " (" + Geschlecht[this.Person1.geschlecht] + "): " + this.Person1.name);
            ausgabe(typename2 + " (" + Geschlecht[this.Person2.geschlecht] + "): " + this.Person2.name);
        };
        return Ehepaar;
    }());
    GenericDemo.Ehepaar = Ehepaar;
    var Beruf = (function () {
        function Beruf(name) {
            this.name = name;
        }
        return Beruf;
    }());
    function run() {
        var William = new Mann("William");
        var Kate = new Frau("Kate");
        var Paar1 = new Ehepaar(William, Kate);
        Paar1.print();
        ausgabe(typeof Paar1);
        // Das geht nicht:
        var William = new Mann("William");
        var beruf = new Beruf("Prinz");
        //var Paar2 = new Ehepaar<Mann, Beruf>(William, beruf);
    }
    GenericDemo.run = run;
})(GenericDemo || (GenericDemo = {}));
//# sourceMappingURL=Generics.js.map