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

Add specialized #first and #last type for tuples #191

Merged
merged 1 commit into from
Aug 21, 2020
Merged

Conversation

soutaro
Copy link
Owner

@soutaro soutaro commented Aug 21, 2020

We know the #first and #last returns the first and last elements of a tuple. So, let's give it a precise type.

# @type var tuple: [Integer, String]
tuple = [1, ""]

a = tuple.first     # Integer
b = tuple.last      # String

@soutaro soutaro merged commit b35a6cd into master Aug 21, 2020
@soutaro soutaro deleted the tuple-first-last branch August 21, 2020 15:36
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

Successfully merging this pull request may close these issues.

1 participant