Skip to content

Trying out typeprof [wip] #16

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Trying out typeprof [wip] #16

wants to merge 7 commits into from

Conversation

marcandre
Copy link
Member

No description provided.

@marcandre marcandre marked this pull request as draft November 11, 2020 04:30
@@ -156,15 +156,15 @@ class Matrix
def row_vectors : -> (Array[(Matrix | Vector)?])
def column_vectors : -> (Array[(Matrix | Vector)?])
def to_matrix : -> Matrix
def to_a : -> (Array[(Array[Integer] | Array[Integer] | Array[untyped] | String)?])
def to_a : -> (Array[(Array[Integer] | Array[Integer] | Array[untyped] | Integer | String)?])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mame:
In this PR, you get the generated rbs file from typeprof after I've replaced each_with_index with each.with_index.
First commit shows result without any hint. This commit I tell it Matrix@rows and Vector@elements which should help a lot... but it makes some things worse. The perfect result here should be Array[Array[numeric]] (if it could reuse my type definition), or Array[Array[Integer | Float | Rational | Complex]] otherwise.

Array[nil] or Array[String] are very wrong...
Note that Array[Integer] | Array[Integer] is redundant.

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