-
Notifications
You must be signed in to change notification settings - Fork 0
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
PYP last qn #594
Comments
I might be wrong but I think the "this" in line 24 refers to the MyStream in line 22, and this.get() in line 22 will return an object of type R which causes an error since fn expects a type T object (?) maybe you can try replacing "this" with "MyStream.this" in line 24 and see if it compiles |
@mingshan2705 it works now with that. dint see that too HAHAH thank you!! |
@mingshan2705 how does MyStream.this know which MyStream it is pointing to |
u need the MyStream or else it wil run recursively with the R get() |
Im not really sure also HAHA but something similar was discussed in recitation 7 qn 2.. maybe you can check that out |
Yeah it doesn't really make logical sense as qualified this is a non-generic context, meaning its just something you need to remember that you can do. https://docs.oracle.com/javase/specs/jls/se10/html/jls-15.html#jls-15.8.4 |
This is the same issue as in recitation 07, q2b) as pointed out above. You run into a recursive loop when you this.get() because it's calling the get method of your global MyStream instead of the local MyStream which is what you want. |
hi anyone knows why this wont compile?
The text was updated successfully, but these errors were encountered: