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

fix resolve poly for proc types #426

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

laytan
Copy link
Contributor

@laytan laytan commented Jul 11, 2024

You can consider this a bug report with an attempted fix from myself.

Opening this would crash (I think you need to have inlay hints enabled):

package main

main :: proc() {
    b := foo(1, 2, proc(a: int, b: int) {})
}

foo :: proc {
    foo1,
    foo2,
}

foo1 :: proc(a: $T, c: $C/proc(a: T)) -> int {
    return 1
}

foo2 :: proc(a: $T, b: $T2, c: $C/proc(a: T, b: T2)) -> int {
}

from reading the other cases this seems the appropriate fix but I could be wrong.

Inlay hints with procedure groups don't work anyway so this doesn't actually change anything noticeable, just prevents a crash.

@DanielGavin
Copy link
Owner

DanielGavin commented Jul 11, 2024

I'll check it out. I didn't even know you could use generics with procedure signatures like that. That complexes everything further with generics in group for finding the correct candidates.

@laytan
Copy link
Contributor Author

laytan commented Jul 11, 2024

Yeah I originally got the pattern from core:thread, it has _with_data procs using this, only when I added it to a proc group OLS started crashing.

@DanielGavin DanielGavin merged commit 905716a into DanielGavin:master Jul 11, 2024
5 checks passed
@laytan laytan deleted the fix-resolve-poly-proc-type branch July 11, 2024 20:32
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.

2 participants