Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NPE in type analysis #3359

Closed
stevemessick opened this issue Jun 1, 2012 · 2 comments
Closed

NPE in type analysis #3359

stevemessick opened this issue Jun 1, 2012 · 2 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-cannot-reproduce Closed as we were unable to reproduce the reported issue
Milestone

Comments

@stevemessick
Copy link
Contributor

I was checking whether code completion works for library prefixes. It doesn't. I'm getting NPEs in type analysis.

!STACK 0
java.lang.NullPointerException
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitIdentifier(TypeAnalyzer.java:1243)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitIdentifier(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartIdentifier.accept(DartIdentifier.java:52)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.typeOf(TypeAnalyzer.java:879)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.nonVoidTypeOf(TypeAnalyzer.java:894)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.checkInvocation(TypeAnalyzer.java:1847)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitMethodInvocation(TypeAnalyzer.java:960)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitMethodInvocation(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartMethodInvocation.accept(DartMethodInvocation.java:66)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.typeOf(TypeAnalyzer.java:879)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitExprStmt(TypeAnalyzer.java:1130)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitExprStmt(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartExprStmt.accept(DartExprStmt.java:31)
    at com.google.dart.compiler.ast.NodeList.accept(NodeList.java:52)
    at com.google.dart.compiler.ast.DartBlock.visitChildren(DartBlock.java:36)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.typeAsVoid(TypeAnalyzer.java:938)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitBlock(TypeAnalyzer.java:934)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitBlock(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartBlock.accept(DartBlock.java:41)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.typeOf(TypeAnalyzer.java:879)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitFunction(TypeAnalyzer.java:1204)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitFunction(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartFunction.accept(DartFunction.java:49)
    at com.google.dart.compiler.ast.DartMethodDefinition.visitChildren(DartMethodDefinition.java:59)
    at com.google.dart.compiler.ast.DartMethodDefinition$DartMethodWithInitializersDefinition.visitChildren(DartMethodDefinition.java:86)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.typeAsVoid(TypeAnalyzer.java:938)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitMethodDefinition(TypeAnalyzer.java:1394)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitMethodDefinition(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:64)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visit(TypeAnalyzer.java:1957)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitClass(TypeAnalyzer.java:1013)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitClass(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartClass.accept(DartClass.java:186)
    at com.google.dart.compiler.ast.NodeList.accept(NodeList.java:52)
    at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:56)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.typeAsVoid(TypeAnalyzer.java:938)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitUnit(TypeAnalyzer.java:1817)
    at com.google.dart.compiler.type.TypeAnalyzer$Analyzer.visitUnit(TypeAnalyzer.java:1)
    at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:62)
    at com.google.dart.compiler.type.TypeAnalyzer.exec(TypeAnalyzer.java:155)
    at com.google.dart.compiler.DartCompiler.analyzeLibraries(DartCompiler.java:1226)
    at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1164)
    at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:855)
    at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:481)
    at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:106)
    at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveLibrary(DartCompilerUtilities.java:722)
    at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.analyzeDelta(DartCompilerUtilities.java:511)
    at com.google.dart.tools.core.internal.completion.CompletionEngine.complete(CompletionEngine.java:1448)
    at com.google.dart.tools.core.internal.completion.CompletionEngine.complete(CompletionEngine.java:1366)
    at com.google.dart.tools.core.internal.model.OpenableElementImpl.codeComplete(OpenableElementImpl.java:379)
    at com.google.dart.tools.core.internal.model.CompilationUnitImpl.codeComplete(CompilationUnitImpl.java:970)
    at com.google.dart.tools.core.internal.model.CompilationUnitImpl.codeComplete(CompilationUnitImpl.java:957)
    at com.google.dart.tools.ui.internal.text.dart.DartCompletionProposalComputer.internalComputeCompletionProposals(DartCompletionProposalComputer.java:329)
    at com.google.dart.tools.ui.internal.text.dart.DartCompletionProposalComputer.computeCompletionProposals(DartCompletionProposalComputer.java:120)
    at com.google.dart.tools.ui.internal.text.dart.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:224)
    at com.google.dart.tools.ui.internal.text.dart.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:119)
    at com.google.dart.tools.ui.internal.text.dart.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:407)
    at com.google.dart.tools.ui.internal.text.dart.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:227)
    at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1830)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:482)
    at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:377)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3935)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3612)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at com.google.dart.tools.deploy.DartIDEApplication.start(DartIDEApplication.java:48)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

@pq
Copy link
Member

pq commented Jun 5, 2012

Added this to the M1 milestone.
Removed Area-Editor label.
Added Area-Analyzer label.

@scheglov
Copy link
Contributor

scheglov commented Jun 9, 2012

Set owner to @scheglov.
Added CannotReproduce label.

@stevemessick stevemessick added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-cannot-reproduce Closed as we were unable to reproduce the reported issue labels Jun 9, 2012
@stevemessick stevemessick added this to the M1 milestone Jun 9, 2012
copybara-service bot pushed a commit that referenced this issue Mar 29, 2022
Changes:
```
> git log --format="%C(auto) %h %s" 8f5ab7b..94ae66a
 https://dart.googlesource.com/pub.git/+/94ae66a6 Refine what a relative uri means in a git path (#3212)
 https://dart.googlesource.com/pub.git/+/cc4c1292 Only call Package.listFiles once per publish. (#3346)
 https://dart.googlesource.com/pub.git/+/f4484073 Fix test/global/activate/git_package_test test on windows (#3361)
 https://dart.googlesource.com/pub.git/+/610ce7f2 Refactor descriptors (#3305)
 https://dart.googlesource.com/pub.git/+/953b6097 Substitute pub.dartlang.org for of pub.dev (#3358)
 https://dart.googlesource.com/pub.git/+/7a6ea396 Add support for pubspec overrides file (#3215)
 https://dart.googlesource.com/pub.git/+/8abfed9d Global activate git path and ref (#3356)
 https://dart.googlesource.com/pub.git/+/d1c0e3f9 Revert "Add flag controlling creation of `.packages` file. (#2757)" (#3357)
 https://dart.googlesource.com/pub.git/+/274f5ad9 Fix signals test (#3359)
 https://dart.googlesource.com/pub.git/+/83437005 Avoid failing in gitignore validator (#3354)
 https://dart.googlesource.com/pub.git/+/3082796f dependency_services: Don't download archives on apply (#3352)
 https://dart.googlesource.com/pub.git/+/48d0ffaf dependency_services: Use ^ constraints for widened intervals when possible (#3349)
 https://dart.googlesource.com/pub.git/+/826e2086 Remove obsolete test (#3347)
 https://dart.googlesource.com/pub.git/+/35e5140b Bump analyzer from 2.8.0 to 3.3.1 (#3341)
 https://dart.googlesource.com/pub.git/+/52f2bdc2 Enable dependabot (#3340)
 https://dart.googlesource.com/pub.git/+/1e70c0c7 Remove `uploader` command (#3335)
 https://dart.googlesource.com/pub.git/+/3174a264 Warn if git version is not high enough for supporting all features (#3332)
 https://dart.googlesource.com/pub.git/+/3f7a3cb7 Don't analyze ignored directories in directory-validator (#3331)
 https://dart.googlesource.com/pub.git/+/e8f36614 Allow use of token for talking to pub.dev (#3330)
 https://dart.googlesource.com/pub.git/+/b93bf88f Upgrade `package:tar` to version `0.5.4`. (#3313)
 https://dart.googlesource.com/pub.git/+/fbc9732e Support for different versioning strategies in dependency_services (#3320)
 https://dart.googlesource.com/pub.git/+/93c7cfcd Update repository-spec-v2.md (#3311)
 https://dart.googlesource.com/pub.git/+/941191f7 dependency_services (#3304)
 https://dart.googlesource.com/pub.git/+/61175cb6 fix: relative to the current directory rules (#3297)
 https://dart.googlesource.com/pub.git/+/f27e90d3 Upgrade other versions conservatively with --major-versions (#3295)
 https://dart.googlesource.com/pub.git/+/a2461417 Add flag controlling creation of `.packages` file. (#2757)

```

Diff: https://dart.googlesource.com/pub.git/+/8f5ab7b1aba3b9f66b56246d77e167990339d317~..94ae66a660cc187cc46ceaf1ab96bdcf8d48a313/
Change-Id: I121fa281ad77991ef10938a3c228ce1d62e748db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238901
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
copybara-service bot pushed a commit that referenced this issue Mar 29, 2022
This reverts commit 6e00bb1.

Reason for revert: https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/flutter-engine-linux/16089/overview

Original change's description:
> Bump pub to 94ae66a660cc187cc46ceaf1ab96bdcf8d48a313
>
> Changes:
> ```
> > git log --format="%C(auto) %h %s" 8f5ab7b..94ae66a
>  https://dart.googlesource.com/pub.git/+/94ae66a6 Refine what a relative uri means in a git path (#3212)
>  https://dart.googlesource.com/pub.git/+/cc4c1292 Only call Package.listFiles once per publish. (#3346)
>  https://dart.googlesource.com/pub.git/+/f4484073 Fix test/global/activate/git_package_test test on windows (#3361)
>  https://dart.googlesource.com/pub.git/+/610ce7f2 Refactor descriptors (#3305)
>  https://dart.googlesource.com/pub.git/+/953b6097 Substitute pub.dartlang.org for of pub.dev (#3358)
>  https://dart.googlesource.com/pub.git/+/7a6ea396 Add support for pubspec overrides file (#3215)
>  https://dart.googlesource.com/pub.git/+/8abfed9d Global activate git path and ref (#3356)
>  https://dart.googlesource.com/pub.git/+/d1c0e3f9 Revert "Add flag controlling creation of `.packages` file. (#2757)" (#3357)
>  https://dart.googlesource.com/pub.git/+/274f5ad9 Fix signals test (#3359)
>  https://dart.googlesource.com/pub.git/+/83437005 Avoid failing in gitignore validator (#3354)
>  https://dart.googlesource.com/pub.git/+/3082796f dependency_services: Don't download archives on apply (#3352)
>  https://dart.googlesource.com/pub.git/+/48d0ffaf dependency_services: Use ^ constraints for widened intervals when possible (#3349)
>  https://dart.googlesource.com/pub.git/+/826e2086 Remove obsolete test (#3347)
>  https://dart.googlesource.com/pub.git/+/35e5140b Bump analyzer from 2.8.0 to 3.3.1 (#3341)
>  https://dart.googlesource.com/pub.git/+/52f2bdc2 Enable dependabot (#3340)
>  https://dart.googlesource.com/pub.git/+/1e70c0c7 Remove `uploader` command (#3335)
>  https://dart.googlesource.com/pub.git/+/3174a264 Warn if git version is not high enough for supporting all features (#3332)
>  https://dart.googlesource.com/pub.git/+/3f7a3cb7 Don't analyze ignored directories in directory-validator (#3331)
>  https://dart.googlesource.com/pub.git/+/e8f36614 Allow use of token for talking to pub.dev (#3330)
>  https://dart.googlesource.com/pub.git/+/b93bf88f Upgrade `package:tar` to version `0.5.4`. (#3313)
>  https://dart.googlesource.com/pub.git/+/fbc9732e Support for different versioning strategies in dependency_services (#3320)
>  https://dart.googlesource.com/pub.git/+/93c7cfcd Update repository-spec-v2.md (#3311)
>  https://dart.googlesource.com/pub.git/+/941191f7 dependency_services (#3304)
>  https://dart.googlesource.com/pub.git/+/61175cb6 fix: relative to the current directory rules (#3297)
>  https://dart.googlesource.com/pub.git/+/f27e90d3 Upgrade other versions conservatively with --major-versions (#3295)
>  https://dart.googlesource.com/pub.git/+/a2461417 Add flag controlling creation of `.packages` file. (#2757)
>
> ```
>
> Diff: https://dart.googlesource.com/pub.git/+/8f5ab7b1aba3b9f66b56246d77e167990339d317~..94ae66a660cc187cc46ceaf1ab96bdcf8d48a313/
> Change-Id: I121fa281ad77991ef10938a3c228ce1d62e748db
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238901
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

TBR=sigurdm@google.com,jonasfj@google.com

Change-Id: I2402e8647ad79a613d8be55a85a7f05f511a4081
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239301
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
copybara-service bot pushed a commit that referenced this issue Mar 30, 2022
Changes:
```
> git log --format="%C(auto) %h %s" 8f5ab7b..a3a102a
 https://dart.googlesource.com/pub.git/+/a3a102a5 Fix equality and hashcode for the sdk descriptors (#3367)
 https://dart.googlesource.com/pub.git/+/94ae66a6 Refine what a relative uri means in a git path (#3212)
 https://dart.googlesource.com/pub.git/+/cc4c1292 Only call Package.listFiles once per publish. (#3346)
 https://dart.googlesource.com/pub.git/+/f4484073 Fix test/global/activate/git_package_test test on windows (#3361)
 https://dart.googlesource.com/pub.git/+/610ce7f2 Refactor descriptors (#3305)
 https://dart.googlesource.com/pub.git/+/953b6097 Substitute pub.dartlang.org for of pub.dev (#3358)
 https://dart.googlesource.com/pub.git/+/7a6ea396 Add support for pubspec overrides file (#3215)
 https://dart.googlesource.com/pub.git/+/8abfed9d Global activate git path and ref (#3356)
 https://dart.googlesource.com/pub.git/+/d1c0e3f9 Revert "Add flag controlling creation of `.packages` file. (#2757)" (#3357)
 https://dart.googlesource.com/pub.git/+/274f5ad9 Fix signals test (#3359)
 https://dart.googlesource.com/pub.git/+/83437005 Avoid failing in gitignore validator (#3354)
 https://dart.googlesource.com/pub.git/+/3082796f dependency_services: Don't download archives on apply (#3352)
 https://dart.googlesource.com/pub.git/+/48d0ffaf dependency_services: Use ^ constraints for widened intervals when possible (#3349)
 https://dart.googlesource.com/pub.git/+/826e2086 Remove obsolete test (#3347)
 https://dart.googlesource.com/pub.git/+/35e5140b Bump analyzer from 2.8.0 to 3.3.1 (#3341)
 https://dart.googlesource.com/pub.git/+/52f2bdc2 Enable dependabot (#3340)
 https://dart.googlesource.com/pub.git/+/1e70c0c7 Remove `uploader` command (#3335)
 https://dart.googlesource.com/pub.git/+/3174a264 Warn if git version is not high enough for supporting all features (#3332)
 https://dart.googlesource.com/pub.git/+/3f7a3cb7 Don't analyze ignored directories in directory-validator (#3331)
 https://dart.googlesource.com/pub.git/+/e8f36614 Allow use of token for talking to pub.dev (#3330)
 https://dart.googlesource.com/pub.git/+/b93bf88f Upgrade `package:tar` to version `0.5.4`. (#3313)
 https://dart.googlesource.com/pub.git/+/fbc9732e Support for different versioning strategies in dependency_services (#3320)
 https://dart.googlesource.com/pub.git/+/93c7cfcd Update repository-spec-v2.md (#3311)
 https://dart.googlesource.com/pub.git/+/941191f7 dependency_services (#3304)
 https://dart.googlesource.com/pub.git/+/61175cb6 fix: relative to the current directory rules (#3297)
 https://dart.googlesource.com/pub.git/+/f27e90d3 Upgrade other versions conservatively with --major-versions (#3295)
 https://dart.googlesource.com/pub.git/+/a2461417 Add flag controlling creation of `.packages` file. (#2757)

```

Diff: https://dart.googlesource.com/pub.git/+/8f5ab7b1aba3b9f66b56246d77e167990339d317~..a3a102a549388a6dbfecc9252fabb618f9a2f5f7/
Change-Id: I8d0ea375039ea450d397871d9fac35d590ea8869
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239315
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-cannot-reproduce Closed as we were unable to reproduce the reported issue
Projects
None yet
Development

No branches or pull requests

3 participants