Skip to content

Don't warn about flexible types in REPL wrapper objects - #27058

Merged
SolalPirelli merged 1 commit into
scala:mainfrom
dotty-staging:fix-repl-flexible-type-warning
Sep 11, 2026
Merged

SolalPirelli merged 1 commit into
scala:mainfrom
dotty-staging:fix-repl-flexible-type-warning

Conversation

@olhotak

@olhotak olhotak commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

The compiler warns when a class member's inferred result type leaks a flexible type: a library should specify the types of its public API explicitly. The REPL wraps every input in a synthetic object, which triggers the warning. Suppress the warning for the REPL's synthetic object.

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

Human encountered the warning running the existing test suite with explicit nulls, and came up with the fix.
LLM created a minimized test.
Human reviewed the test.

How was the solution tested?

New automated test

The compiler warns when a class member's inferred result type
leaks a flexible type: a library should specify the types of its public API explicitly.
The REPL wraps every input in a synthetic object, which triggers the warning. Suppress the warning for the REPL's synthetic object.
@SolalPirelli
SolalPirelli enabled auto-merge (squash) September 11, 2026 08:22
@SolalPirelli
SolalPirelli merged commit 55cef6b into scala:main Sep 11, 2026
63 checks passed
@SolalPirelli
SolalPirelli deleted the fix-repl-flexible-type-warning branch September 11, 2026 10:24
@WojciechMazur WojciechMazur added this to the 3.10.1 milestone Oct 11, 2026
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.

3 participants