//// [assignmentCompatWithCallSignatures4.ts] // These are mostly permitted with the current loose rules. All ok unless otherwise noted. module Errors { class Base { foo: string; } class Derived extends Base { bar: string; } class Derived2 extends Derived { baz: string; } class OtherDerived extends Base { bing: string; } module WithNonGenericSignaturesInBaseType { // target type with non-generic call signatures var a2: (x: number) => string[]; var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived2; var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; var a10: (...x: Base[]) => Base; var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; var a12: (x: Array, y: Array) => Array; var a14: { (x: number): number[]; (x: string): string[]; }; var a15: (x: { a: string; b: number }) => number; var a16: { (x: { (a: number): number; (a?: number): number; }): number[]; (x: { (a: boolean): boolean; (a?: boolean): boolean; }): boolean[]; }; var a17: { (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; }; var b2: (x: T) => U[]; a2 = b2; b2 = a2; var b7: (x: (arg: T) => U) => (r: T) => V; a7 = b7; b7 = a7; var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, { foo: number } and Base are incompatible b8 = a8; // error, { foo: number } and Base are incompatible var b10: (...x: T[]) => T; a10 = b10; b10 = a10; var b11: (x: T, y: T) => T; a11 = b11; b11 = a11; var b12: >(x: Array, y: Array) => T; a12 = b12; b12 = a12; var b15: (x: { a: T; b: T }) => T; a15 = b15; b15 = a15; var b15a: (x: { a: T; b: T }) => number; a15 = b15a; b15a = a15; var b16: (x: (a: T) => T) => T[]; a16 = b16; b16 = a16; var b17: (x: (a: T) => T) => any[]; a17 = b17; b17 = a17; } module WithGenericSignaturesInBaseType { // target type has generic call signature var a2: (x: T) => T[]; var b2: (x: T) => string[]; a2 = b2; b2 = a2; // target type has generic call signature var a3: (x: T) => string[]; var b3: (x: T) => T[]; a3 = b3; b3 = a3; } } //// [assignmentCompatWithCallSignatures4.js] var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; // These are mostly permitted with the current loose rules. All ok unless otherwise noted. var Errors; (function (Errors) { var Base = (function () { function Base() { } return Base; })(); var Derived = (function (_super) { __extends(Derived, _super); function Derived() { _super.apply(this, arguments); } return Derived; })(Base); var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { _super.apply(this, arguments); } return Derived2; })(Derived); var OtherDerived = (function (_super) { __extends(OtherDerived, _super); function OtherDerived() { _super.apply(this, arguments); } return OtherDerived; })(Base); var WithNonGenericSignaturesInBaseType; (function (WithNonGenericSignaturesInBaseType) { // target type with non-generic call signatures var a2; var a7; var a8; var a10; var a11; var a12; var a14; var a15; var a16; var a17; var b2; a2 = b2; b2 = a2; var b7; a7 = b7; b7 = a7; var b8; a8 = b8; b8 = a8; var b10; a10 = b10; b10 = a10; var b11; a11 = b11; b11 = a11; var b12; a12 = b12; b12 = a12; var b15; a15 = b15; b15 = a15; var b15a; a15 = b15a; b15a = a15; var b16; a16 = b16; b16 = a16; var b17; a17 = b17; b17 = a17; })(WithNonGenericSignaturesInBaseType || (WithNonGenericSignaturesInBaseType = {})); var WithGenericSignaturesInBaseType; (function (WithGenericSignaturesInBaseType) { // target type has generic call signature var a2; var b2; a2 = b2; b2 = a2; // target type has generic call signature var a3; var b3; a3 = b3; b3 = a3; })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); })(Errors || (Errors = {}));