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

using_directives parser crashes on */*/Foo.scala #3374

Closed
prolativ opened this issue Dec 17, 2024 · 1 comment · Fixed by #3381
Closed

using_directives parser crashes on */*/Foo.scala #3374

prolativ opened this issue Dec 17, 2024 · 1 comment · Fixed by #3381
Assignees
Labels
--exclude Issues tied with the excluding inputs. bug Something isn't working using directives Issues tied with using directives.

Comments

@prolativ
Copy link

Version(s)
1.5.4

Describe the bug
Using a nested wildcard (*/*/...) in exclude directive results in a crash caused by java.lang.ArrayIndexOutOfBoundsException

To Reproduce
Having the following project structure:

  • ./project.scala:
//> using exclude */*/Foo.scala
  • ./dir1/dir2/Foo.scala:
val foo // invalid code

Try to compile the project:

scala-cli compile .

Expected behaviour
Should not crash. Also the invalid file Foo.scala should be excluded from compilation sources and the compilation should succeed

@prolativ prolativ added the bug Something isn't working label Dec 17, 2024
@Gedochao Gedochao added the --exclude Issues tied with the excluding inputs. label Dec 18, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Dec 19, 2024

So it turns out this isn't an --exclude issue at all.
it's the using_directives parser that breaks on //> using exclude */*/Foo.scala
The workaround is to wrap the directive value in double quotes:

//> using exclude "*/*/Foo.scala"

Of course, it's mainly the exclusion feature that ends up affected, since we don't use this sort of syntax elsewhere.

@Gedochao Gedochao changed the title Crash on nested wildcard path source exclusion using_directives parser crashes on */*/Foo.scala Dec 19, 2024
@Gedochao Gedochao added the using directives Issues tied with using directives. label Dec 19, 2024
@Gedochao Gedochao self-assigned this Dec 19, 2024
@Gedochao Gedochao moved this to In progress in Issue Board Dec 19, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Issue Board Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--exclude Issues tied with the excluding inputs. bug Something isn't working using directives Issues tied with using directives.
Projects
Status: Done
2 participants