Repository: TypeScript
Issue: Functions with same intersection and conditional type in parameter list not assignable to each other
Labels: Needs Investigation

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.5.1

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

function, intersection, conditional type, parameter list, assignable

**Code**

```ts
/**
 * We should never be able to create a value of this type legitimately.
 * 
 * `ErrorMessageT` is our error message
 */
interface CompileError<ErrorMessageT extends any[]> {
  /**
   * There should never be a value of this type
   */
  readonly __compileError : never;
}
type ErrorA = CompileError<["I am error A"]>;
type ErrorB = CompileError<["I am error B"]>;

declare const errorA : ErrorA;
/**
 * Different compile errors are assignable to each other.
 */
const errorB : ErrorB = errorA;

/**
 * Pretend this is `v1.0.0` of your library.
 */
declare function foo <N extends number> (
  /**
   * This is how we use `CompileError<>` to prevent `3` from being
   * a parameter
   */
  n : (
    N &
    (Extract<3, N> extends never ?
    unknown :
    CompileError<[3, "is not allowed; received", N]>)
  )
) : void;

/**
 * Argument of type '3' is not assignable to parameter of type
 * 'CompileError<[3, "is not allowed; received", 3]>'.
 */
foo(3);
/**
 * OK!
 */
foo(5);
/**
 * Argument of type '3 | 5' is not assignable to parameter of type
 * 'CompileError<[3, "is not allowed; received", 3 | 5]>'.
 */
foo(5 as 3|5);
/**
 * Argument of type 'number' is not assignable to parameter of type
 * 'CompileError<[3, "is not allowed; received", number]>'.
 */
foo(5 as number);

///////////////////////////////////////////////////////////////////

/**
 * The same as `foo<>()` but with a different error message.
 * 
 * Pretend this is `v1.1.0` of your library.
 */
declare function bar <N extends number> (
  n : (
    N &
    (Extract<3, N> extends never ?
    unknown :
    CompileError<[3, "is not allowed; received", N]>)
  )
) : void;

/**
 * Expected: Assignable to each other
 * Actual: Not assignable to each other
 */
const fooIsAssignableToBar : typeof bar = foo;
const barIsAssignableToFoo : typeof foo = bar;
```

**Expected behavior:**

The following should have no errors,
```ts
const fooIsAssignableToBar : typeof bar = foo;
const barIsAssignableToFoo : typeof foo = bar;
```

**Actual behavior:**

It has errors

**Playground Link:** 

[Playground](http://www.typescriptlang.org/play/#code/PQKhFgCgAIWh1AptAzgCwPYFcA2ATaAO0QDdEAnaAI2QEMqdkAXDaAY3MVqbuhNpxZkGAGbQmaAJYpxATwAOyRgHNJTSQFtuiHLIB0UWNENwABgFFy5DOQCyiFClrLEAFVPRp0bJQrXKGg5OLibAUJKEPOQitGzIAMIYGvKSjJb+ADzpNvaOzm7QiAAePIR4MrSEsgDaALoAfNAA3obQoBAw0EauaBTI6Nj4RKQU1Lz8gsJiEl5MCoitsGGdnLR4GIS60AD622xJKWlWNtAAXMNk5ADcUAC+UHOK0NnkAILQALzQicmpiC8ZaoAIgAktBaBpCsdKK8gQ0bpBHsgXgAhT7fA5-AHAsEQqH+aAouH1BFQPCINg4WicdgbFBMfE2d7nF6vBHtEzQAAikhEIj6kVpv0YjPIFRptEckmUhHoIpYhViaG8EgoBhgIGW+0I9NFaJZ0LRXz8TNJkA5GugAAVOKUCDMZF5TCQAIx6AAMHo8omgsh80Bwkio5Gp+lCZIpVJpIiwhDY6g20BEGFYGQAcoUSogyjJCFgNDRyI0ABStC1dbpSR0yTAAd2gteQWBQyFMP0O-2hGXqHgV8k4ZEFpgAzB4RNZITQIspFnBaNB5NSIYgorPll1CGdoKXOl0MwAyRbb8wlEPxjLDgA00DTjWKdtzI0oAH4j7GANaEDC1zenI-trEu2qK9oCBLwvwZAQcG-RA8CuaBODiSQyDwIFrzTBoAEpWmwyBMK3EgMEkOCoCgcs4FechlHzbMGR9JFoAAcmHRjPFzDBIKlGU5WYVhFxDQIom8aZ5k5RiAKOTJgOvMD2MgnBoMbOCEIpRBkNgtDoGHBpGPVJYoGTDBi2HTD2TATkAHkAGkAEJw0gQziwAVlMsjzMtSjqMCQV6PmJjh2gAAfaAnNY8COPBLjZQYXiFyXQTRl8xQxIkzspJA2SiAiqCYOUxC1JQzSAuCpydL0zUDJTZzIq0wKXLMjojE8mifJEp5GLzAsKDCuTIpQaVovlPj4pXRK2oWS1xMxSSbEBDLwvkxTYPg-L1NQ69OsLMr7Mcpyas2ihXMgMjgFOs7zouy6ruum7bru0jzXcyt+mXGrTEM7ti0wjwqCwBlazUZV5zwXl+U4QUTQCIJ8nK4xLRtUaynEKs2OgZ03Tdd1vTEP0sEoQNg1DcrlnJSlqWQGM4wTTcqGpaB00zB8iHzQsS1aX9tyPA8j2LE8mDPJgL3Qu8sxzC5RlfXdoA-L8fzOf9prS2bpNAhbwQU3KVtUtbNIw+pcK6XD8POQjiLNcjniKRR41g85XiinjxFYLg2GVDjenITlXnjLABHONNsodmKncVV2VQ9+ztV1QyQRQe3+u4mLXAwFE6fOJEfVpygvkMhEo4ZLPY-jgaeOTgAxFMtwzsRDPRLOriAA)

**Related Issues:** 

https://github.com/microsoft/TypeScript/issues/21756

Also, related to my comment here,

https://github.com/microsoft/TypeScript/issues/23689#issuecomment-512114782

-----