electricessence / TypeScript.NET

A JavaScript-Friendly .NET Based TypeScript Library (Moved)
https://github.com/electricessence/TypeScript.NET-Core
Other
251 stars 36 forks source link

Constraint of a type parameter cannot reference any type parameter from the same type parameter list. #33

Closed Acentrage closed 8 years ago

Acentrage commented 8 years ago
Constraint of a type parameter cannot reference any type parameter from the same type parameter list.

I'm getting this error in Visual Studio for ILinkedNodeList, ILinkedNode and assertValidDetached.

I fixed it by replacing "TNode" with "any":

interface ILinkedNodeList<TNode extends ILinkedNode<TNode>>
interface ILinkedNodeList<TNode extends ILinkedNode<any>>

Any other solutions or should I create a PR?

Visual Studio 2015, Update 1 TypeScript 1.7.6.0

electricessence commented 8 years ago

K. Just a note, I'm using 1.8.7 and this code was updated in the last month. Lemme do a bit more investigating. What about only changing the code on the assertion function?

electricessence commented 8 years ago

Yeah, so that function is effectively private, so we could change anything to any. If you change that, but keep the interface the way it was, does the error go away?