This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | ClassCastException: com.sun.tools.javac.code.Type$ForAll cannot be cast to com.sun.tools.javac.code.Type$MethodType | ||
---|---|---|---|
Product: | java | Reporter: | lolo_101 <lolo_101> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 213250 |
Attachments: | stacktrace |
Description
lolo_101
2015-08-24 13:41:49 UTC
Created attachment 155581 [details]
stacktrace
Lolo_101: could you provide a more complete example ? I've tried a simple source file using your code: public class Foo<U> { public interface Page<T> { public T whatever(T x); } public Page<U> load(int a) { return new Page<>() { // Here i clicked on Page to auto-implement all methods. } } } but the IDE does not even offer the 'implement all methods', since the compiler is unable to infer the type argument for the anonymous class (In reply to Svata Dedic from comment #2) > Lolo_101: could you provide a more complete example ? I've tried a simple > source file using your code: > > public class Foo<U> { > public interface Page<T> { > public T whatever(T x); > } > > public Page<U> load(int a) { > return new Page<>() { // Here i clicked on Page to auto-implement all > methods. > } > } > } > > > but the IDE does not even offer the 'implement all methods', since the > compiler is unable to infer the type argument for the anonymous class I just pressed Alt-Enter with the cursor on "Page" on the specified line. I dont know what hints were suggested. I just hoped for 'implement all' to be present to save me some key strokes. Cannot reproduce, as noted in comment #2. If the error happens again, please save the exact source for further investigation; |