Skip to content

Don't infer method in select position #7998

@tgodzik

Description

@tgodzik

Describe the bug

This is tested in ImportMissingSymbolCrossLspSuite

If you have two files

package x

def main =
  println(1.incr)

and

package example
object IntEnrichment:
  extension (num: Int)
    def incr = num + 1

auto import will be suggested, but it will also suggest to infer a method, which is not possible currently.

Expected behavior

No infer should be possible or an extension method created instead.

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v1.6.4

Scala version/s

3.3.7

Extra context or search terms

scala 3 infer action

Metadata

Metadata

Assignees

Labels

Scala 3Generic ticket relating to Scala 3bugSomething that is making a piece of functionality unusablepresentation-compilerSomething relating to the presentation compiler

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions