Skip to content

Conversation

@cb372
Copy link
Owner

@cb372 cb372 commented Nov 28, 2020

Given foo.bar(123, "abc", ???), we look up the foo.bar symbol to get the types of its parameters, which gives us the type of the hole.

Note: there's a big assumption here that the number of params exactly matches the number of args, which is not true in the case of default args, varargs, etc. So this will not catch all cases, but it's a step in the right direction.

Fixes #43

Given `foo.bar(123, "abc", ???)`, we look up the `foo.bar` symbol to get
the types of its parameters, which gives us the type of the hole.

Note: there's a big assumption here that the number of params exactly
matches the number of args, which is not true in the case of default
args, varargs, etc. So this will not catch all cases, but it's a step in
the right direction.
^
src/test/resources/val-var-def-one-liners/input.scala:31:
Found hole with type: Int
Found hole with type: B
Copy link
Owner Author

Choose a reason for hiding this comment

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

I feel like if I can find the right incantation I can persuade the compiler to fill in this type param with the concrete type. More experimentation needed...

def hole15(x: String) = x.contains(???)
^
src/test/resources/val-var-def-one-liners/input.scala:35:
Found hole with type: A => Boolean
Copy link
Owner Author

Choose a reason for hiding this comment

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

Similarly here

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.

Functionality not invoked for function-typed holes

1 participant