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

"Bad state: no element" for "{**/,}foo.dart" #80

Open
DanTup opened this issue Jul 10, 2023 · 0 comments
Open

"Bad state: no element" for "{**/,}foo.dart" #80

DanTup opened this issue Jul 10, 2023 · 0 comments
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DanTup
Copy link

DanTup commented Jul 10, 2023

I'm not sure if this is a valid pattern, but while looking at #52880 I tried to use "{**/,}foo.dart", but it resulted in an exception:

print(Glob('{**/,}foo.dart').matches("c:\\foo\\bar.txt"));
Unhandled exception:
Bad state: No element
#0      List.first (dart:core-patch/growable_array.dart:343:5)
#1      SequenceNode.canMatchAbsolute (package:glob/src/ast.dart:60:38)
#2      OptionsNode.canMatchAbsolute.<anonymous closure> (package:glob/src/ast.dart:371:59)
#3      ListBase.any (dart:collection/list.dart:114:15)
#4      OptionsNode.canMatchAbsolute (package:glob/src/ast.dart:371:40)
#5      SequenceNode.canMatchAbsolute (package:glob/src/ast.dart:60:44)
#6      Glob._patternCanMatchAbsolute (package:glob/glob.dart:70:46)
#7      Glob.matchAsPrefix (package:glob/glob.dart:162:9)
#8      Glob.matches (package:glob/glob.dart:154:32)
#9      main (file:///C:/Dev/Test%20Projects/blogtest/bin/blogtest.dart:5:32)
#10     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:294:33)
#11     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

If the pattern is invalid and exception is expected, it should be more descriptive than this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants