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

Preserve stack frame for mock parent method call #712

Merged
merged 1 commit into from Jan 3, 2019
Merged

Preserve stack frame for mock parent method call #712

merged 1 commit into from Jan 3, 2019

Conversation

letientai299
Copy link

@letientai299 letientai299 commented Jan 3, 2019

Fixes #705

Go tip contains following commmit, that inlines function with single
call bodies.

golang/go@13baf4b

(*Call).On() is the exact target for the improvement in Go repo. Due to
the inlining, assert.CallerInfo() can't not detect the file and line
number of the call to (*Mock).On() from (*Call).On(). Thus, the test
fails.

Adding the compiler directive go:noinline prevent this effect and make
mock package works with go tip as before.

Go tip contains following commmit, that inlines function with single
call bodies.

golang/go@13baf4b

`(*Call).On()` is the exact target for the improvement in Go repo. Due to
the inlining, assert.CallerInfo() can't not detect the file and line
number of the call to `(*Mock).On()` from `(*Call).On()`. Thus, the test
fails.

Adding the compiler directive `go:noinline` prevent this effect and make
mock package works with go tip as before.
@letientai299
Copy link
Author

This would fix #705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants