Closed

Description
TypeScript Version: 3.0.0-dev.20180707
Code
/** @typedef {"a" | "b"} U */
/** @return {U} */
function f0() { return "a"; }
/** @type {() => U} */
function f1() { return "a"; }
/** @typedef {() => U} RetU */
/** @type {RetU} */
function f2() { return "a"; }
/** @type {RetU} */
const f3 = () => "a";
const x0 = f0();
const x1 = f1();
const x2 = f2();
const x3 = f3();
Expected behavior:
x0
through x3
are all of type "a" | "b"
.
Actual behavior:
x2
is of type string
.
Noticed while reviewing #25486.