Skip to content

Golden test pretty-printing sometimes generated invalid HashSet constructor #400

@lihaoyi

Description

@lihaoyi

Seems to happen with large sets, which then fail to compile because HashSet is not imported by default. Impor

[854/870] libs.tabcomplete.test.compile
[854] [info] compiling 1 Scala source to /Users/lihaoyi/Github/mill/out/libs/tabcomplete/test/compile.dest/classes ...
[854] [error] -- [E006] Not Found Error: /Users/lihaoyi/Github/mill/libs/tabcomplete/test/src/mill/tabcomplete/TabCompleteTests.scala:171:10 
[854] [error] 171 |          HashSet(
[854] [error]     |          ^^^^^^^
[854] [error]     |          Not found: HashSet
[854] [error]     |
[854] [error]     | longer explanation available when compiling with `-explain`
[854] [error] -- [E006] Not Found Error: /Users/lihaoyi/Github/mill/libs/tabcomplete/test/src/mill/tabcomplete/TabCompleteTests.scala:206:10 
[854] [error] 206 |          HashSet(
[854] [error]     |          ^^^^^^^
[854] [error]     |          Not found: HashSet
[854] [error]     |
[854] [error]     | longer explanation available when compiling with `-explain`
[854] [error] two errors found

Importing it manually via import scala.collection.immutable.HashSet works, but we should probably just special case this to generate Set(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions