-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutioncheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript
Milestone
Description
TypeScript Version: 3.5.0-dev.20190508
Search Terms: module add overload
Code
// nanohtml.d.ts
export default function<T extends HTMLElement = HTMLElement>(strings: TemplateStringsArray, ...keys: any[]): T;
// @ts-check
// index.js
// install [email protected]
const nanohtml = require("nanohtml");
/** @type {HTMLAnchorElement} */
const a = nanohtml`<a href="example.com">Example</a>`;
Expected behavior:
a
should be HTMLAnchorElement
.
Actual behavior:
Error: Type 'HTMLElement' is missing the following properties from type 'HTMLAnchorElement': ...
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutioncheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript