rillig / gobco

Measure branch coverage of golang tests
62 stars 12 forks source link

cannot use xx (variable of type xx) as type bool in argument to GobcoCover #35

Closed 503440692 closed 5 months ago

503440692 commented 5 months ago

image @rillig thank you for developing the tool: gobco. I have encountered some issues while using the tool. Please refer to the image above for the problem details. It would be appreciated if you could help me resolve this issue.

rillig commented 5 months ago

Thank you for reporting this bug, this was indeed an edge case that I hadn't though of.

503440692 commented 5 months ago

Awesome, thank you so much for an incredibly fast fix!

rillig commented 5 months ago

If the fix works for you, you're lucky. I found some more edge cases in which the instrumented code doesn't compile, such as cond := MyBool(true) && MyBool(false), which originally has type MyBool but after instrumentation has type bool. I'll have to add proper type resolution to cover this case as well. Stay tuned.