-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Tuple conformance #822
Tuple conformance #822
Conversation
// error | ||
numArray = numStrTuple; | ||
~~~~~~~~ | ||
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heyYui, can you file a bug on having us provide a better error message here. Here we're giving an error about 'pop' being wrong (where pop is a method on Array), where it would probably be better to indicate that the type of the tuple array isn't assignable to number.
This is all about improving the error message and providing more directed, useful, information to the person who runs into this.
Thanks!
@@ -0,0 +1,15 @@ | |||
var strNumTuple: [string, number] = ["foo", 10]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this file names ' ? or is this a github issue?
if it is the earlier, please fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i see.. this seems to be the same as indexerWithTuple.ts, so delete it then.
👍 |
Conformance test for tuple feature (PR #428)