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.
Created attachment 156351 [details] Test project Issue #255429 revealed a problem in elements resolution. Consider the attached project. At line 28 there is "child" variable being accessed. When I ask for it's element, it return Symbol$ClassSymbol, whose name is "child" and type is an instance of Type$ErrorType. This is clearly wrong. To reproduce, when visitIdentifier(IdentifierTree arg0, ...) is called during the parsing, get an element this way: TreePath currentPath = getCurrentPath(); TreePath identifierPath = TreePath.getPath(currentPath, arg0); Element elm = evaluationContext.getTrees().getElement(identifierPath); The elm is wrongly Symbol$ClassSymbol and ((TypeElement) elm).asType() is Type$ErrorType. When you add parenthesis around the for-loop body: for (Worker child: worker.getChildren()) { startYear(child, listener); } it gets corrected: elm is Symbol$VarSymbol and elm.getKind() is LOCAL_VARIABLE.
I can't seem to reproduce it in the dev build