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

require explicit result type for implicit conversions? #801

Closed
scabug opened this Issue Apr 23, 2008 · 6 comments

Comments

Projects
None yet
1 participant
@scabug
Copy link

scabug commented Apr 23, 2008

Martin wrote on the scala-user list, "In general it's a good idea always to write a result type for an implicit method. Maybe the language should require it."

I've been bitten myself a couple times by problems that went away once I added a result type to an implicit so I thought I'd open a ticket on this.

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Apr 23, 2008

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Apr 24, 2008

@mcdirmid said:
We should disallow type annotations on implicit defs to prevent vicious implicit recursive applications. Actually, I follow this rule in my own code when possible, its saved me more than a few times.

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Apr 29, 2008

@dubochet said:
Sean, can you please elaborate on your contribution a little?

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Aug 11, 2008

@odersky said:
I have implemented a slightly more permissive rule: An implicit conversion without explicit result type is visible only in the text following its own definition. That way, we avoid the cyclic reference errors. I close for now, to see how this works. If we still have issues we migth come back to this.

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone next_bugfix deleted

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Apr 28, 2010

@paulp said:
See also #2206. Explanatory error message fixed so it will print in r21706.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment