Skip to content
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

Stack overflow on [this()] reference #3786

Closed
lrhn opened this issue Jun 16, 2024 · 1 comment
Closed

Stack overflow on [this()] reference #3786

lrhn opened this issue Jun 16, 2024 · 1 comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lrhn
Copy link
Member

lrhn commented Jun 16, 2024

I was trying to deduce the valid DartDoc source references, and tried [this()] as a synnonym of [CurrentClass()] as a reference to the unnamed constructor.
That crashed DartDoc with a stack overflow, with a stack trace ending in:

dartdoc 8.0.9 (/somewhere/sdk/doc-test/dartdev) failed: Stack Overflow         
#0      ElementImpl.hashCode (package:analyzer/src/dart/element/element.dart:2063:3)   
#1      Object.hash (dart:core/object.dart:207:19)                                     
#2      ConstructedModelElementsKey.hashCode (package:dartdoc/src/model/package_graph.dart:1032:36)                                                                           
#3      ConstructedModelElementsKey.hashCode (package:dartdoc/src/model/package_graph.dart)                                                                                   
#4      new ModelElement.for_ (package:dartdoc/src/model/model_element.dart:224:70)    
#5      new ModelElement.forElement (package:dartdoc/src/model/model_element.dart:106:25)                                                                                     
#6      ModelElement.definingLibrary (package:dartdoc/src/model/model_element.dart:451:7)                                                                                     
#7      Container.referenceParents (package:dartdoc/src/model/container.dart:250:55)   
#8      CommentReferable.referenceBy (package:dartdoc/src/model/comment_referable.dart:53:25)                                                                                 
#9      CommentReferable._recurseChildrenAndFilter (package:dartdoc/src/model/comment_referable.dart:139:28)                                                                  
#10     CommentReferable.referenceBy (package:dartdoc/src/model/comment_referable.dart:67:22)                                                                                 
#11     CommentReferable._recurseChildrenAndFilter (package:dartdoc/src/model/comment_referable.dart:139:28)                                                                  
#12     CommentReferable.referenceBy (package:dartdoc/src/model/comment_referable.dart:67:22)
#13     CommentReferable._recurseChildrenAndFilter (package:dartdoc/src/model/comment_referable.dart:139:28) 
#14     CommentReferable.referenceBy (package:dartdoc/src/model/comment_referable.dart:67:22)

I see you are removing [this] as a way to say this [CurrentClass]. Maybe [this()] just shouldn't work either - it's not really readable.
(Although I can see why [this] can be useful, it's better to not use an unqualified "this" in DartDoc anyway.)

@srawlins srawlins added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jun 17, 2024
@srawlins
Copy link
Member

Great catch! Fixed with #3765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants