tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(63,9): error TS2322: Type '() => T' is not assignable to type '<T>() => T'.
  Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(64,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>() => T'.
  Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>() => T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>() => T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(67,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>() => T'.
  Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(69,9): error TS2322: Type '() => T' is not assignable to type '<T>(x?: T) => T'.
  Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(70,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(71,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(72,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(73,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(75,9): error TS2322: Type '() => T' is not assignable to type '<T>(x: T) => T'.
  Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(76,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(77,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(78,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(79,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(81,9): error TS2322: Type '() => T' is not assignable to type '<T>(x: T, y?: T) => T'.
  Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(82,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(83,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(84,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(85,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(87,9): error TS2322: Type '() => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
  Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
    'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(88,9): error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(89,9): error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(90,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(91,9): error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
  Types of parameters 'x' and 'x' are incompatible.
    Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '<T>(x: T) => any' is not assignable to type '<T>() => T'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '<T>(x: T, y: T) => any' is not assignable to type '<T>(x: T) => T'.


==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (29 errors) ====
    // call signatures in derived types must have the same or fewer optional parameters as the target for assignment
    
    module ClassTypeParam {
        class Base<T> {
            a: () => T;
            a2: (x?: T) => T;
            a3: (x: T) => T;
            a4: (x: T, y?: T) => T;
            a5: (x?: T, y?: T) => T;
    
            init = () => {
                this.a = () => null; // ok, same T of required params
                this.a = (x?: T) => null; // ok, same T of required params
                this.a = (x: T) => null; // error, too many required params
                ~~~~~~
!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'.
    
                this.a2 = () => null; // ok, same T of required params
                this.a2 = (x?: T) => null; // ok, same T of required params
                this.a2 = (x: T) => null; // ok, same number of params
    
                this.a3 = () => null; // ok, fewer required params
                this.a3 = (x?: T) => null; // ok, fewer required params
                this.a3 = (x: T) => null; // ok, same T of required params
                this.a3 = (x: T, y: T) => null;  // error, too many required params
                ~~~~~~~
!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'.
    
                this.a4 = () => null; // ok, fewer required params
                this.a4 = (x?: T, y?: T) => null; // ok, fewer required params
                this.a4 = (x: T) => null; // ok, same T of required params
                this.a4 = (x: T, y: T) => null;  // ok, same number of params
    
    
                this.a5 = () => null; // ok, fewer required params
                this.a5 = (x?: T, y?: T) => null; // ok, fewer required params
                this.a5 = (x: T) => null; // ok, all present params match
                this.a5 = (x: T, y: T) => null;  // ok, same number of params
            }
        }
    }
    
    module GenericSignaturesInvalid {
    
        class Base2 {
            a: <T>() => T;
            a2: <T>(x?: T) => T;
            a3: <T>(x: T) => T;
            a4: <T>(x: T, y?: T) => T;
            a5: <T>(x?: T, y?: T) => T;
        }
    
        class Target<T> {
            a: () => T;
            a2: (x?: T) => T;
            a3: (x: T) => T;
            a4: (x: T, y?: T) => T;
            a5: (x?: T, y?: T) => T;
        }
    
    
        function foo<T>() {
            var b: Base2;
            var t: Target<T>;
    
            // all errors
            b.a = t.a;
            ~~~
!!! error TS2322: Type '() => T' is not assignable to type '<T>() => T'.
!!! error TS2322:   Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:     'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:58:18: This type parameter might need an `extends T` constraint.
            b.a = t.a2;
            ~~~
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>() => T'.
!!! error TS2322:   Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:     'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:58:18: This type parameter might need an `extends T` constraint.
            b.a = t.a3;
            ~~~
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>() => T'.
            b.a = t.a4;
            ~~~
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>() => T'.
            b.a = t.a5;
            ~~~
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>() => T'.
!!! error TS2322:   Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:     'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:58:18: This type parameter might need an `extends T` constraint.
    
            b.a2 = t.a;
            ~~~~
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x?: T) => T'.
!!! error TS2322:   Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:     'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:58:18: This type parameter might need an `extends T` constraint.
            b.a2 = t.a2;
            ~~~~
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:43:14: This type parameter might need an `extends T` constraint.
            b.a2 = t.a3;
            ~~~~
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:43:14: This type parameter might need an `extends T` constraint.
            b.a2 = t.a4;
            ~~~~
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:43:14: This type parameter might need an `extends T` constraint.
            b.a2 = t.a5;
            ~~~~
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:43:14: This type parameter might need an `extends T` constraint.
    
            b.a3 = t.a;
            ~~~~
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x: T) => T'.
!!! error TS2322:   Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:     'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:58:18: This type parameter might need an `extends T` constraint.
            b.a3 = t.a2;
            ~~~~
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:44:14: This type parameter might need an `extends T` constraint.
            b.a3 = t.a3;
            ~~~~
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:44:14: This type parameter might need an `extends T` constraint.
            b.a3 = t.a4;
            ~~~~
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:44:14: This type parameter might need an `extends T` constraint.
            b.a3 = t.a5;
            ~~~~
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:44:14: This type parameter might need an `extends T` constraint.
    
            b.a4 = t.a;
            ~~~~
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x: T, y?: T) => T'.
!!! error TS2322:   Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:     'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:58:18: This type parameter might need an `extends T` constraint.
            b.a4 = t.a2;
            ~~~~
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:45:14: This type parameter might need an `extends T` constraint.
            b.a4 = t.a3;
            ~~~~
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:45:14: This type parameter might need an `extends T` constraint.
            b.a4 = t.a4;
            ~~~~
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:45:14: This type parameter might need an `extends T` constraint.
            b.a4 = t.a5;
            ~~~~
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:45:14: This type parameter might need an `extends T` constraint.
    
            b.a5 = t.a;
            ~~~~
!!! error TS2322: Type '() => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
!!! error TS2322:   Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:     'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:58:18: This type parameter might need an `extends T` constraint.
            b.a5 = t.a2;
            ~~~~
!!! error TS2322: Type '(x?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:46:14: This type parameter might need an `extends T` constraint.
            b.a5 = t.a3;
            ~~~~
!!! error TS2322: Type '(x: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:46:14: This type parameter might need an `extends T` constraint.
            b.a5 = t.a4;
            ~~~~
!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:46:14: This type parameter might need an `extends T` constraint.
            b.a5 = t.a5;
            ~~~~
!!! error TS2322: Type '(x?: T, y?: T) => T' is not assignable to type '<T>(x?: T, y?: T) => T'.
!!! error TS2322:   Types of parameters 'x' and 'x' are incompatible.
!!! error TS2322:     Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
!!! error TS2322:       'T' could be instantiated with an arbitrary type which could be unrelated to 'T'.
!!! related TS2208 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts:46:14: This type parameter might need an `extends T` constraint.
        }
    }
    
    module GenericSignaturesValid {
    
        class Base2 {
            a: <T>() => T;
            a2: <T>(x?: T) => T;
            a3: <T>(x: T) => T;
            a4: <T>(x: T, y?: T) => T;
            a5: <T>(x?: T, y?: T) => T;
    
            init = () => {
                this.a = <T>() => null; // ok, same T of required params
                this.a = <T>(x?: T) => null; // ok, same T of required params
                this.a = <T>(x: T) => null; // error, too many required params
                ~~~~~~
!!! error TS2322: Type '<T>(x: T) => any' is not assignable to type '<T>() => T'.
    
                this.a2 = <T>() => null; // ok, same T of required params
                this.a2 = <T>(x?: T) => null; // ok, same T of required params
                this.a2 = <T>(x: T) => null; // ok, same number of params
    
                this.a3 = <T>() => null; // ok, fewer required params
                this.a3 = <T>(x?: T) => null; // ok, fewer required params
                this.a3 = <T>(x: T) => null; // ok, same T of required params
                this.a3 = <T>(x: T, y: T) => null;  // error, too many required params
                ~~~~~~~
!!! error TS2322: Type '<T>(x: T, y: T) => any' is not assignable to type '<T>(x: T) => T'.
    
                this.a4 = <T>() => null; // ok, fewer required params
                this.a4 = <T>(x?: T, y?: T) => null; // ok, fewer required params
                this.a4 = <T>(x: T) => null; // ok, same T of required params
                this.a4 = <T>(x: T, y: T) => null;  // ok, same number of params
    
    
                this.a5 = <T>() => null; // ok, fewer required params
                this.a5 = <T>(x?: T, y?: T) => null; // ok, fewer required params
                this.a5 = <T>(x: T) => null; // ok, all present params match
                this.a5 = <T>(x: T, y: T) => null;  // ok, same number of params
            }
        }
    }