# Compiler

**URL:** https://contributors.scala-lang.org/c/compiler/14.md?page=2

[Latest](https://contributors.scala-lang.org/latest.md) · [Categories](https://contributors.scala-lang.org/categories.md)

**Page:** 3

---

## [Implicit conversion not working with opaque types](https://contributors.scala-lang.org/t/implicit-conversion-not-working-with-opaque-types/6068)

<div class="topic-metadata">

**Author:** [@readren](https://contributors.scala-lang.org/u/readren)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 8:45pm UTC](https://contributors.scala-lang.org/t/implicit-conversion-not-working-with-opaque-types/6068 "2023-01-20T20:45:55Z")

</div>

The intention of the Sheet1 class is to store values in a typeless container but operate with them type-safely. class Sheet1 { opaque type Ref\[X\] = Int; private val cells: ArrayBuffer\[Any\] = ArrayBuffer.empty; def …

---

## [We are considering dropping support for Scala 2.11 in Scala.js core](https://contributors.scala-lang.org/t/we-are-considering-dropping-support-for-scala-2-11-in-scala-js-core/6016)

<div class="topic-metadata">

**Author:** [@sjrd](https://contributors.scala-lang.org/u/sjrd)\
**Replies:** 0\
**Last updated:** [December 4, 2022, 1:37pm UTC](https://contributors.scala-lang.org/t/we-are-considering-dropping-support-for-scala-2-11-in-scala-js-core/6016 "2022-12-04T13:37:38Z")

</div>

We are considering dropping support for Scala 2.11 in Scala.js core. Please upvote or downvote the GitHub issue, and comment if you have any (remaining) 2.11 use case.

---

## [Compilation error when local variable name clashes with implicit one](https://contributors.scala-lang.org/t/compilation-error-when-local-variable-name-clashes-with-implicit-one/6008)

<div class="topic-metadata">

**Author:** [@auldanov](https://contributors.scala-lang.org/u/auldanov)\
**Replies:** 1\
**Last updated:** [November 30, 2022, 8:02pm UTC](https://contributors.scala-lang.org/t/compilation-error-when-local-variable-name-clashes-with-implicit-one/6008 "2022-11-30T20:02:11Z")

</div>

The code below compiles fine import cats.\_ import cats.implicits.\_ import scala.concurrent.{ExecutionContext, Future} implicit val e: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global val x =…

---

## [Expected compiler behavior? (2)](https://contributors.scala-lang.org/t/expected-compiler-behavior-2/5908)

<div class="topic-metadata">

**Author:** [@Stephane](https://contributors.scala-lang.org/u/Stephane)\
**Replies:** 3\
**Last updated:** [September 3, 2022, 12:49pm UTC](https://contributors.scala-lang.org/t/expected-compiler-behavior-2/5908 "2022-09-03T12:49:19Z")

</div>

Is it expected that the compiler doesn’t accept the code below? trait Root: type T trait A\[T\] trait B(val root: Root) extends A\[root.T\] class AWrapper\[T\](val a: A\[T\]) final class BWrapper(val b: B) extends AWrappe…

---

## [Help needed teasing apart compiler bugs](https://contributors.scala-lang.org/t/help-needed-teasing-apart-compiler-bugs/5880)

<div class="topic-metadata">

**Author:** [@Stephane](https://contributors.scala-lang.org/u/Stephane)\
**Replies:** 2\
**Last updated:** [August 22, 2022, 11:41am UTC](https://contributors.scala-lang.org/t/help-needed-teasing-apart-compiler-bugs/5880 "2022-08-22T11:41:19Z")

</div>

I don’t know how to report this, and I don’t know where one bug ends and another starts… See this code. Language features involved: inline match types dependently typed function types transparent

---

## [Scala 3 unimported given](https://contributors.scala-lang.org/t/scala-3-unimported-given/5857)

<div class="topic-metadata">

**Author:** [@Stephane](https://contributors.scala-lang.org/u/Stephane)\
**Replies:** 1\
**Last updated:** [August 2, 2022, 7:56pm UTC](https://contributors.scala-lang.org/t/scala-3-unimported-given/5857 "2022-08-02T19:56:33Z")

</div>

I asked this question on Scala Users, but didn’t get any answer. I wonder whether it is a bug (if only in the error reported).

---

## [Continue with case class synthetic method generation when abstract method declaration is present](https://contributors.scala-lang.org/t/continue-with-case-class-synthetic-method-generation-when-abstract-method-declaration-is-present/5826)

<div class="topic-metadata">

**Author:** [@peter-empen](https://contributors.scala-lang.org/u/peter-empen)\
**Replies:** 4\
**Last updated:** [July 23, 2022, 7:52am UTC](https://contributors.scala-lang.org/t/continue-with-case-class-synthetic-method-generation-when-abstract-method-declaration-is-present/5826 "2022-07-23T07:52:43Z")

</div>

I’d like to call a synthetic method of the case class in a trait that many case classes will extend like copy in trait MapI\[C\] { def i: Int def s: String def copy(i: Int = this.i, s: String = this.s): C def mapI…

---

## [Context function + overloading error](https://contributors.scala-lang.org/t/context-function-overloading-error/5779)

<div class="topic-metadata">

**Author:** [@charpov](https://contributors.scala-lang.org/u/charpov)\
**Replies:** 1\
**Last updated:** [June 27, 2022, 11:50am UTC](https://contributors.scala-lang.org/t/context-function-overloading-error/5779 "2022-06-27T11:50:12Z")

</div>

I posted this in Scala Users, but didn’t get any comments. I’m still wondering if this is a bug, or if I need to change my design. Consider this code: def withInt(unused: Boolean = false)(n: Int): Int = n + 1 def withI…

---

## [Should instances of refined types be seperate classes if refinements are limited to member types?](https://contributors.scala-lang.org/t/should-instances-of-refined-types-be-seperate-classes-if-refinements-are-limited-to-member-types/5758)

<div class="topic-metadata">

**Author:** [@noresttherein](https://contributors.scala-lang.org/u/noresttherein)\
**Replies:** 1\
**Last updated:** [June 7, 2022, 1:03pm UTC](https://contributors.scala-lang.org/t/should-instances-of-refined-types-be-seperate-classes-if-refinements-are-limited-to-member-types/5758 "2022-06-07T13:03:39Z")

</div>

Currently: class Types { type Type } (new Types { type Type = Int }).getClass val res0: Class\[\_ \<: Types\] = class $anon$1 It seems a bit wasteful. There could be an argument for reflection support, providing addition…

---

## [Improving Scala 3 forward compatibility](https://contributors.scala-lang.org/t/improving-scala-3-forward-compatibility/5298)

<div class="topic-metadata">

**Author:** [@Kordyjan](https://contributors.scala-lang.org/u/Kordyjan)\
**Replies:** 27\
**Last updated:** [May 31, 2022, 8:43pm UTC](https://contributors.scala-lang.org/t/improving-scala-3-forward-compatibility/5298 "2022-05-31T20:43:31Z")

</div>

Scala 3 has very good backward compatibility guarantees between the minor versions. On the other hand, after the recent release of Scala 3.1, we can see that the libraries should be really cautious with updating the comp…

---

## [Sources of implementation for polymorphic tuples](https://contributors.scala-lang.org/t/sources-of-implementation-for-polymorphic-tuples/5665)

<div class="topic-metadata">

**Author:** [@noresttherein](https://contributors.scala-lang.org/u/noresttherein)\
**Replies:** 3\
**Last updated:** [April 5, 2022, 9:01pm UTC](https://contributors.scala-lang.org/t/sources-of-implementation-for-polymorphic-tuples/5665 "2022-04-05T21:01:03Z")

</div>

If I wanted to look into how tuples are implemented and, potentially, propose an improvement, what file(s) I should be looking at? Are tuples kind of regular types after desugaring, or is their implementation somehow har…

---

## [Some interesting behavior with LazyList](https://contributors.scala-lang.org/t/some-interesting-behavior-with-lazylist/5661)

<div class="topic-metadata">

**Author:** [@fre\_ee\_nergy](https://contributors.scala-lang.org/u/fre_ee_nergy)\
**Replies:** 2\
**Last updated:** [March 27, 2022, 12:05pm UTC](https://contributors.scala-lang.org/t/some-interesting-behavior-with-lazylist/5661 "2022-03-27T12:05:53Z")

</div>

Hello, i have some trouble. Why it’s work without the function? val lazyList: LazyList\[Int\] = 999 #:: lazyList.map(\_.toString.split("").map(\_.toInt).product) And in function definition: def digitalRoot(n: Int): Int =…

---

## [Syntax issues with compiler option "-source 3.0-migration" under 3.1.1](https://contributors.scala-lang.org/t/syntax-issues-with-compiler-option-source-3-0-migration-under-3-1-1/5644)

<div class="topic-metadata">

**Author:** [@devlaam](https://contributors.scala-lang.org/u/devlaam)\
**Replies:** 1\
**Last updated:** [March 16, 2022, 9:22am UTC](https://contributors.scala-lang.org/t/syntax-issues-with-compiler-option-source-3-0-migration-under-3-1-1/5644 "2022-03-16T09:22:53Z")

</div>

Compile the following code (in file Main.scala) object NewSyntax: def test1(x: Int, y: Int) = if x == y then "equal" else "different" def test2(x: Int, y: Int) = if (x == y) then "equal" else "differ…

---

## [Breaking match change from Scala 2 to 3 that is too silent](https://contributors.scala-lang.org/t/breaking-match-change-from-scala-2-to-3-that-is-too-silent/5647)

<div class="topic-metadata">

**Author:** [@devlaam](https://contributors.scala-lang.org/u/devlaam)\
**Replies:** 3\
**Last updated:** [March 15, 2022, 4:09pm UTC](https://contributors.scala-lang.org/t/breaking-match-change-from-scala-2-to-3-that-is-too-silent/5647 "2022-03-15T16:09:08Z")

</div>

Consider the following code: object MatchTest { val a: Array\[Long\] = Array(1L) def test(x: Any) = x match { case Array(i: Long) =\> println("Success!") case \_ =\> println("Failure!") } def m…

---

## [Using summonInline\[T\] with summon\[T\] for resolving implicits in inline methods](https://contributors.scala-lang.org/t/using-summoninline-t-with-summon-t-for-resolving-implicits-in-inline-methods/5587)

<div class="topic-metadata">

**Author:** [@andrzejressel](https://contributors.scala-lang.org/u/andrzejressel)\
**Replies:** 2\
**Last updated:** [February 10, 2022, 9:51am UTC](https://contributors.scala-lang.org/t/using-summoninline-t-with-summon-t-for-resolving-implicits-in-inline-methods/5587 "2022-02-10T09:51:37Z")

</div>

Hi. Recently I was contributing code to Kittens, and they’re using inline methods as an alternative of passing a lot of implicits (since all givens from outer scope are available using summonInline). However I’ve realis…

---

## [Verify Error when using mutable fields in parametric enumeration](https://contributors.scala-lang.org/t/verify-error-when-using-mutable-fields-in-parametric-enumeration/5531)

<div class="topic-metadata">

**Author:** [@workstudy-zero](https://contributors.scala-lang.org/u/workstudy-zero)\
**Replies:** 1\
**Last updated:** [January 13, 2022, 8:51am UTC](https://contributors.scala-lang.org/t/verify-error-when-using-mutable-fields-in-parametric-enumeration/5531 "2022-01-13T08:51:57Z")

</div>

I use Scala 3.1.0 (17.0.1, Java OpenJDK 64-Bit Server VM). In this setting, I found a Verify Error when using mutable fields in parametric enumeration as follows: enum A(c: Int): case B(var k: Int) extends A(k) with…

---

## [Compilation error, literal types](https://contributors.scala-lang.org/t/compilation-error-literal-types/5524)

<div class="topic-metadata">

**Author:** [@jk-1](https://contributors.scala-lang.org/u/jk-1)\
**Replies:** 3\
**Last updated:** [January 4, 2022, 8:25pm UTC](https://contributors.scala-lang.org/t/compilation-error-literal-types/5524 "2022-01-04T20:25:22Z")

</div>

My sbt file is: val scala3Version = "3.0.0" lazy val root = project .in(file(".")) .settings( name := "scala-3-advanced", version := "0.1.0", scalaVersion := scala3Version, libraryDependencies ++=…

---

## ["Weird" generic implicit resolution behaviour](https://contributors.scala-lang.org/t/weird-generic-implicit-resolution-behaviour/5512)

<div class="topic-metadata">

**Author:** [@Iltotore](https://contributors.scala-lang.org/u/Iltotore)\
**Replies:** 2\
**Last updated:** [December 30, 2021, 7:33pm UTC](https://contributors.scala-lang.org/t/weird-generic-implicit-resolution-behaviour/5512 "2021-12-30T19:33:24Z")

</div>

In a project I’m working on, I have a project with a given instance looking like this (simplified): class Test\[A, B\] inline given \[A, B\](using A): Test\[A, Test\[A, B\]\] = new Test This works as intended when summoning s…

---

## [PartialFunctions are broken when returning ContextFunctions](https://contributors.scala-lang.org/t/partialfunctions-are-broken-when-returning-contextfunctions/5466)

<div class="topic-metadata">

**Author:** [@jteigen](https://contributors.scala-lang.org/u/jteigen)\
**Replies:** 4\
**Last updated:** [November 29, 2021, 6:03pm UTC](https://contributors.scala-lang.org/t/partialfunctions-are-broken-when-returning-contextfunctions/5466 "2021-11-29T18:03:56Z")

</div>

tested in 3.1.0 and 3.1.1-RC1 Scastie It appears the compiler produces a faulty PartialFunction when returning Context Functions. isDefinedAt is always true regardless of input and applyOrElse throws an exception for …

---

## [Extensions methods with default arguments](https://contributors.scala-lang.org/t/extensions-methods-with-default-arguments/5316)

<div class="topic-metadata">

**Author:** [@charpov](https://contributors.scala-lang.org/u/charpov)\
**Replies:** 4\
**Last updated:** [November 5, 2021, 2:18pm UTC](https://contributors.scala-lang.org/t/extensions-methods-with-default-arguments/5316 "2021-11-05T14:18:04Z")

</div>

I can compile this, inside the same package: extension (str: String) def foo(x: Int) = ??? extension (n: Int) def foo(x: Int) = ??? but I cannot compile this (using 3.1): extension (str: String) def foo(x: Int = 0) = …

---

## [Code not compiling when Unit-returning SAM and overloaded methods involved](https://contributors.scala-lang.org/t/code-not-compiling-when-unit-returning-sam-and-overloaded-methods-involved/5271)

<div class="topic-metadata">

**Author:** [@jlprat](https://contributors.scala-lang.org/u/jlprat)\
**Replies:** 3\
**Last updated:** [September 24, 2021, 9:42am UTC](https://contributors.scala-lang.org/t/code-not-compiling-when-unit-returning-sam-and-overloaded-methods-involved/5271 "2021-09-24T09:42:18Z")

</div>

I recently opened a ticket in dotty https://github.com/lampepfl/dotty/issues/13549. This was closed as “won’t fix” as the proposed change was breaking some community build projects. I understand the reasoning to not pro…

---

## [Unexpected ambiguous implicit argument error](https://contributors.scala-lang.org/t/unexpected-ambiguous-implicit-argument-error/5194)

<div class="topic-metadata">

**Author:** [@eshu](https://contributors.scala-lang.org/u/eshu)\
**Replies:** 2\
**Last updated:** [July 24, 2021, 10:36am UTC](https://contributors.scala-lang.org/t/unexpected-ambiguous-implicit-argument-error/5194 "2021-07-24T10:36:35Z")

</div>

I found a strange behavior of compiler. The minimal code snippet that I was able to create is trait Accessor: def get\[T\](using parser: Parser\[T\]): T = parser(this) type Parser\[T\] = Accessor =\> T trait Configurable …

---

## [Is there an official JVM implementation that should be used for testing optimizations?](https://contributors.scala-lang.org/t/is-there-an-official-jvm-implementation-that-should-be-used-for-testing-optimizations/5043)

<div class="topic-metadata">

**Author:** [@dottyLover](https://contributors.scala-lang.org/u/dottyLover)\
**Replies:** 1\
**Last updated:** [July 14, 2021, 9:16pm UTC](https://contributors.scala-lang.org/t/is-there-an-official-jvm-implementation-that-should-be-used-for-testing-optimizations/5043 "2021-07-14T21:16:46Z")

</div>

Hello. This is my first topic so please tell me if I am doing anything wrong, and I will do my best to make appropriate edits as soon as is possible. I was wondering if there was an official JVM implementation for testi…

---

## [Better name inference for anonymous givens](https://contributors.scala-lang.org/t/better-name-inference-for-anonymous-givens/5179)

<div class="topic-metadata">

**Author:** [@charpov](https://contributors.scala-lang.org/u/charpov)\
**Replies:** 2\
**Last updated:** [July 10, 2021, 1:11pm UTC](https://contributors.scala-lang.org/t/better-name-inference-for-anonymous-givens/5179 "2021-07-10T13:11:03Z")

</div>

While testing two separate implementations of a queue, I ended up defining two givens: given pub: IntQueue\[singlepublic.ConcurrentQueue\[Int\]\] with ... given priv: IntQueue\[singleprivate.ConcurrentQueue\[Int\]\] with …

---

## [Compiler crash when switching Scala version](https://contributors.scala-lang.org/t/compiler-crash-when-switching-scala-version/5176)

<div class="topic-metadata">

**Author:** [@hnrklssn](https://contributors.scala-lang.org/u/hnrklssn)\
**Replies:** 2\
**Last updated:** [July 8, 2021, 6:37pm UTC](https://contributors.scala-lang.org/t/compiler-crash-when-switching-scala-version/5176 "2021-07-08T18:37:51Z")

</div>

I have a compiler crash that has occurred a few times, but I haven’t found a simple way to reproduce it. I’m also not really sure whether to file this as a compiler bug or sbt bug, so any advise there is kindly appreciat…

---

## [Use FQCN in type error message if two or more types have the same name](https://contributors.scala-lang.org/t/use-fqcn-in-type-error-message-if-two-or-more-types-have-the-same-name/5166)

<div class="topic-metadata">

**Author:** [@hnrklssn](https://contributors.scala-lang.org/u/hnrklssn)\
**Replies:** 3\
**Last updated:** [July 1, 2021, 9:22pm UTC](https://contributors.scala-lang.org/t/use-fqcn-in-type-error-message-if-two-or-more-types-have-the-same-name/5166 "2021-07-01T21:22:57Z")

</div>

I recently encountered a confusing type error message because I had absentmindedly named a class ´String´ (details here). The error message did not clarify however that the two types named were in fact not the same class…

---

## [Compiler fails on my small sample code](https://contributors.scala-lang.org/t/compiler-fails-on-my-small-sample-code/5133)

<div class="topic-metadata">

**Author:** [@vpatryshev](https://contributors.scala-lang.org/u/vpatryshev)\
**Replies:** 7\
**Last updated:** [June 14, 2021, 5:09am UTC](https://contributors.scala-lang.org/t/compiler-fails-on-my-small-sample-code/5133 "2021-06-14T05:09:50Z")

</div>

Please checkout my branch with the code that causes failure. Scala 3.0.0-RC3, Java 11. sbt "project scala3;clean;compile;test" (there’s also a script named reproduce) causes \[info\] exception occurred while typecheckin…

---

## [Should the compiler help with inserting end-markes?](https://contributors.scala-lang.org/t/should-the-compiler-help-with-inserting-end-markes/5074)

<div class="topic-metadata">

**Author:** [@bjornregnell](https://contributors.scala-lang.org/u/bjornregnell)\
**Replies:** 11\
**Last updated:** [May 31, 2021, 5:13pm UTC](https://contributors.scala-lang.org/t/should-the-compiler-help-with-inserting-end-markes/5074 "2021-05-31T17:13:14Z")

</div>

Background -rewrite The awesome Scala 3 compiler can help with rewriting from old syntax to new syntax if ... then .. else, for ... do, while do. It can also “de-brace” my code. This is done with these handy sbt command…

---

## [Implement -Ydelambdafy:inline for Scala 3](https://contributors.scala-lang.org/t/implement-ydelambdafy-inline-for-scala-3/5050)

<div class="topic-metadata">

**Author:** [@romainreuillon](https://contributors.scala-lang.org/u/romainreuillon)\
**Replies:** 0\
**Last updated:** [May 6, 2021, 12:49pm UTC](https://contributors.scala-lang.org/t/implement-ydelambdafy-inline-for-scala-3/5050 "2021-05-06T12:49:31Z")

</div>

Dear Devs, thank you for the hard work. I’m enjoying using scala all these years. I am looking into what might be missing to migrate our project to Scala 3. It happend that we are using -Ydelambdafy:inline to make it p…

---

## [Incorrect compiler error "Unable to emit reference to method" with 3-RC2](https://contributors.scala-lang.org/t/incorrect-compiler-error-unable-to-emit-reference-to-method-with-3-rc2/5008)

<div class="topic-metadata">

**Author:** [@jpsacha](https://contributors.scala-lang.org/u/jpsacha)\
**Replies:** 4\
**Last updated:** [April 14, 2021, 3:46pm UTC](https://contributors.scala-lang.org/t/incorrect-compiler-error-unable-to-emit-reference-to-method-with-3-rc2/5008 "2021-04-14T15:46:25Z")

</div>

A form if this post was originally posted on ‘Scala-Users’ with confirmation that it looks like compiler error. The following line of code does not compile with Scala 3.0.0-RC2 (no errors in Scala 2): tableView.selecti…

[Previous page](https://contributors.scala-lang.org/c/compiler/14.md?page=1)

[Next page](https://contributors.scala-lang.org/c/compiler/14.md?page=3)
