Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved TypeScript symbols #265

Open
dpogue opened this issue Apr 18, 2018 · 0 comments
Open

Unresolved TypeScript symbols #265

dpogue opened this issue Apr 18, 2018 · 0 comments

Comments

@dpogue
Copy link
Contributor

dpogue commented Apr 18, 2018

This is admittedly a particularly bizzarre example of TypeScript syntax, but it's our current workaround for some TypeScript limitations with subclassing ES6 built-ins.

// Our hacky helper function:
function safeSubclass<T>(klasstype : T) : T {
  // Bunch of stuff to use Reflect.construct, but essentially:
  return klasstype;
}

// Our subclass:
class MyPromise<T> extends safeSubclass(Promise)<T> { /* ... */ }

When running through dgeni, this results in an unresolved TypeScript symbol:

warn:    Unresolved TypeScript symbol(s): subclass(Promise)<T> - doc "src/helpers/MyPromise" (class)  - from file "src/helpers/promise.ts"

The syntax for the generic type on the promise is super weird, but is correct (and does work exactly as intended).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant