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

Tuple conformance #822

Merged
merged 5 commits into from
Oct 6, 2014
Merged

Tuple conformance #822

merged 5 commits into from
Oct 6, 2014

Conversation

yuit
Copy link
Contributor

@yuit yuit commented Oct 4, 2014

Conformance test for tuple feature (PR #428)

// error
numArray = numStrTuple;
~~~~~~~~
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]':
Copy link
Contributor

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];
Copy link
Contributor

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.

Copy link
Contributor

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.

@mhegazy
Copy link
Contributor

mhegazy commented Oct 6, 2014

👍

yuit pushed a commit that referenced this pull request Oct 6, 2014
@yuit yuit merged commit 85fd141 into master Oct 6, 2014
@yuit yuit deleted the tupleConformance branch October 6, 2014 18:14
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants