Skip to content

Doc: into type constructor: Make implicit import into explicit one - #27023

Open
windymelt wants to merge 1 commit into
scala:language-reference-stablefrom
windymelt:patch-1
Open

windymelt wants to merge 1 commit into
scala:language-reference-stablefrom
windymelt:patch-1

Conversation

@windymelt

Copy link
Copy Markdown

The code examples in the documentation demonstrate the use of an into type constructor without explicit import statements. While the documentation's description of into's location implies the need for an import, I believe this documentation is incomplete. Therefore, I've added explicit documentation about the need for an import. The phrasing may still be improved.

Have you relied on LLM-based tools in this contribution?

No

Added import statement for using 'into' as a type constructor, required in following examples.

@tanishiking tanishiking left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you mentioned, into is defined a few lines later in scala.Conversion. Asking for import Conversion.into above that definition feels a bit wired to me.
Also, it looks as if every later snippets requires the import, but some of them actually don't (like Example 1 call site).

What do you think about adding import Conversion.into in Example 2 instead? Then I think readers can infer import Conversion.into is required for every into usage as a type constructor.

@windymelt

Copy link
Copy Markdown
Author

Thank you for response.

Yes, this approach seems appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants