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

inlining fails with "following variables are shadowed" #6924

Open
scarf005 opened this issue Nov 9, 2024 · 1 comment
Open

inlining fails with "following variables are shadowed" #6924

scarf005 opened this issue Nov 9, 2024 · 1 comment

Comments

@scarf005
Copy link
Contributor

scarf005 commented Nov 9, 2024

Describe the bug

Scala code runner version: 1.4.3
Scala version (default): 3.5.2

  1. write following code:
package `2015`.day24

def quantumEntanglement(xs: Iterable[Long]): Long = xs.product

@main def main() =
  val input = Vector(1L, 2L)
  val groupWeight = input.sum / 3

  val answer = (1 to input.size).iterator
    .map { n =>
      val combs = input.combinations(n).filter(_.sum == groupWeight).toVector
      combs
    }

  println(answer)
  1. attempt to inline combs.

Expected behavior

    .map { n =>
-      val combs = input.combinations(n).filter(_.sum == groupWeight).toVector
-      combs
+      input.combinations(n).filter(_.sum == groupWeight).toVector
    }

code inlining is done without issue.

Actual behavior

however, inlining fails with:

Following variables are shadowed: scala.Long.==.

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v1.42.0

Extra context or search terms

reports.zip

@tgodzik
Copy link
Contributor

tgodzik commented Nov 10, 2024

Thanks for reporting! I will try and take a look later next week

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

No branches or pull requests

2 participants