Open
Description
TypeScript Version: 3.8.1-rc
Search Terms:
- quick fix
- implement interface
Repo
export type UrlString = string;
export type UUID = string;
export interface I_IdToUrlMapper {
mapIdToUrl(id: UUID): UrlString
mapUrlToId(url: UrlString): UUID
}
export class IdToUrlMapper implements I_IdToUrlMapper {
}
Run implement interface on IdToUrlMapper
Expected behavior:
Type aliases are preserved
export class IdToUrlMapper implements I_IdToUrlMapper {
mapIdToUrl(id: UUID): UrlString {
throw new Error("Method not implemented.");
}
mapUrlToId(url: UrlString): UUID {
throw new Error("Method not implemented.");
}
}
Actual behavior:
Both methods use string
:
export class IdToUrlMapper implements I_IdToUrlMapper {
mapIdToUrl(id: string): string {
throw new Error("Method not implemented.");
}
mapUrlToId(url: string): string {
throw new Error("Method not implemented.");
}
}
Related Issues