{"action":"created","issue":{"url":"https://api.github.com/repos/TiVo/intellij-haxe/issues/316","labels_url":"https://api.github.com/repos/TiVo/intellij-haxe/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/TiVo/intellij-haxe/issues/316/comments","events_url":"https://api.github.com/repos/TiVo/intellij-haxe/issues/316/events","html_url":"https://github.com/TiVo/intellij-haxe/issues/316","id":90580369,"number":316,"title":"Assertion failure during Semantic Annotation.","user":{"login":"EBatTiVo","id":7231977,"avatar_url":"https://avatars.githubusercontent.com/u/7231977?v=3","gravatar_id":"","url":"https://api.github.com/users/EBatTiVo","html_url":"https://github.com/EBatTiVo","followers_url":"https://api.github.com/users/EBatTiVo/followers","following_url":"https://api.github.com/users/EBatTiVo/following{/other_user}","gists_url":"https://api.github.com/users/EBatTiVo/gists{/gist_id}","starred_url":"https://api.github.com/users/EBatTiVo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBatTiVo/subscriptions","organizations_url":"https://api.github.com/users/EBatTiVo/orgs","repos_url":"https://api.github.com/users/EBatTiVo/repos","events_url":"https://api.github.com/users/EBatTiVo/events{/privacy}","received_events_url":"https://api.github.com/users/EBatTiVo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TiVo/intellij-haxe/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/TiVo/intellij-haxe/labels/Priority%202","name":"Priority 2","color":"ff5e00"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-24T06:24:30Z","updated_at":"2015-07-02T06:58:16Z","closed_at":null,"body":"When annotating code, sometimes a reference does not have an identifier.  However, the HaxeReferenceExpressionImpl class has the getIdentifier function marked with a NotNull annotation, and calls findNotNullChildByClass() which throws an error when the entity does not exist.\r\n\r\nThe solution is to remove the NotNull annotation and call findChildByClass().  There are also two usages of that function that need to be verified.  TypeChecker.check() and HaxeResolver.resolve().\r\n\r\nThis code generates the following PSI:\r\n```haxe\r\n        var bo = new haxe.io.BytesOutput();\r\n```\r\n```\r\n          LOCAL_VAR_DECLARATION 'var bo = new haxe.io.BytesOutput();'(85932,85967)\r\n            PsiJavaToken:var('var')(85932,85935)\r\n            PsiWhiteSpace(' ')(85935,85936)\r\n            LOCAL_VAR_DECLARATION_PART 'bo'(85936,85966)\r\n              COMPONENT_NAME 'bo'(85936,85938)\r\n                IDENTIFIER (85936,85938)\r\n                  PsiJavaToken:ID('bo')(85936,85938)\r\n              PsiWhiteSpace(' ')(85938,85939)\r\n              VAR_INIT (85939,85966)\r\n                PsiJavaToken:=('=')(85939,85940)\r\n                PsiWhiteSpace(' ')(85940,85941)\r\n                NEW_EXPRESSION :new haxe.io.BytesOutput():HaxeNewExpressionImpl(85941,85966)\r\n                  PsiJavaToken:new('new')(85941,85944)\r\n                  PsiWhiteSpace(' ')(85944,85945)\r\n                  TYPE (85945,85964)\r\n                    REFERENCE_EXPRESSION :haxe.io.BytesOutput:HaxeReferenceExpressionImpl(85945,85964)\r\n                      REFERENCE_EXPRESSION :haxe.io:HaxeReferenceExpressionImpl(85945,85952)\r\n                        REFERENCE_EXPRESSION :haxe:HaxeReferenceExpressionImpl(85945,85949)\r\n                          IDENTIFIER (85945,85949)\r\n                            PsiJavaToken:ID('haxe')(85945,85949)\r\n                        PsiJavaToken:.('.')(85949,85950)\r\n                        REFERENCE_EXPRESSION :io:HaxeReferenceExpressionImpl(85950,85952)\r\n                          IDENTIFIER (85950,85952)\r\n                            PsiJavaToken:ID('io')(85950,85952)\r\n                      PsiJavaToken:.('.')(85952,85953)\r\n                      REFERENCE_EXPRESSION :BytesOutput:HaxeReferenceExpressionImpl(85953,85964)\r\n                        IDENTIFIER (85953,85964)\r\n                          PsiJavaToken:ID('BytesOutput')(85953,85964)\r\n                  PsiJavaToken:(('(')(85964,85965)\r\n                  PsiJavaToken:)(')')(85965,85966)\r\n            PsiJavaToken:;(';')(85966,85967)\r\n```\r\n\r\nThe partial stack is:\r\n```\r\n [30253974]  ERROR - n.impl.GeneralHighlightingPass - IntelliJ IDEA (Cardea) IU-135.1286  Build #IU-135.1286 \r\n[30253974]  ERROR - n.impl.GeneralHighlightingPass - JDK: 1.6.0_41 \r\n[30253974]  ERROR - n.impl.GeneralHighlightingPass - VM: Java HotSpot(TM) Server VM \r\n[30253974]  ERROR - n.impl.GeneralHighlightingPass - Vendor: Sun Microsystems Inc. \r\n[30253974]  ERROR - n.impl.GeneralHighlightingPass - OS: Linux \r\n[30253974]  ERROR - n.impl.GeneralHighlightingPass - Last Action: Find \r\n[30254287]  ERROR - tellij.psi.impl.PsiElementBase - haxe.io.BytesOutput\r\nparent=haxe.io.BytesOutput \r\njava.lang.Throwable\r\n\tat com.intellij.openapi.diagnostic.Logger.error(Logger.java:113)\r\n\tat com.intellij.psi.impl.PsiElementBase.notNullChild(PsiElementBase.java:282)\r\n\tat com.intellij.psi.impl.PsiElementBase.findNotNullChildByClass(PsiElementBase.java:306)\r\n\tat com.intellij.plugins.haxe.lang.psi.impl.HaxeReferenceExpressionImpl.getIdentifier(HaxeReferenceExpressionImpl.java:45)\r\n\tat com.intellij.plugins.haxe.ide.annotator.TypeChecker.check(HaxeSemanticAnnotator.java:168)\r\n\tat com.intellij.plugins.haxe.ide.annotator.HaxeSemanticAnnotator.analyzeSingle(HaxeSemanticAnnotator.java:52)\r\n\tat com.intellij.plugins.haxe.ide.annotator.HaxeSemanticAnnotator.annotate(HaxeSemanticAnnotator.java:41)\r\n\tat com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:160)\r\n\tat com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:103)\r\n\tat com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$5.run(GeneralHighlightingPass.java:312)\r\n```\r\n\r\nTIR: STB-11118"},"comment":{"url":"https://api.github.com/repos/TiVo/intellij-haxe/issues/comments/117935775","html_url":"https://github.com/TiVo/intellij-haxe/issues/316#issuecomment-117935775","issue_url":"https://api.github.com/repos/TiVo/intellij-haxe/issues/316","id":117935775,"user":{"login":"EBatTiVo","id":7231977,"avatar_url":"https://avatars.githubusercontent.com/u/7231977?v=3","gravatar_id":"","url":"https://api.github.com/users/EBatTiVo","html_url":"https://github.com/EBatTiVo","followers_url":"https://api.github.com/users/EBatTiVo/followers","following_url":"https://api.github.com/users/EBatTiVo/following{/other_user}","gists_url":"https://api.github.com/users/EBatTiVo/gists{/gist_id}","starred_url":"https://api.github.com/users/EBatTiVo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBatTiVo/subscriptions","organizations_url":"https://api.github.com/users/EBatTiVo/orgs","repos_url":"https://api.github.com/users/EBatTiVo/repos","events_url":"https://api.github.com/users/EBatTiVo/events{/privacy}","received_events_url":"https://api.github.com/users/EBatTiVo/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T06:58:16Z","updated_at":"2015-07-02T06:58:16Z","body":"A hack which works around the issue is in PR #324.  Even if we take that, a proper fix for this requires a BNF fix, because HaxeReferenceExpression is a generated class."}}