Skip to content

Commit 5e01978

Browse files
committed
Don't copy implicit flags from getter to setter
1 parent c460b8c commit 5e01978

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ object desugar {
158158
vparamss = (setterParam :: Nil) :: Nil,
159159
tpt = TypeTree(defn.UnitType),
160160
rhs = setterRhs
161-
).withMods((mods | Accessor) &~ CaseAccessor)
161+
).withMods((mods | Accessor) &~ (CaseAccessor | Implicit | Given))
162162
Thicket(vdef, setter)
163163
}
164164
else vdef
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class TC { type T }
2+
3+
class C given (TC { type T = Int })
4+
5+
def f1 given (x: TC) = ???
6+
def f2 given (@unchecked x: TC) = ???
7+
inline def f3 given (inline x: TC) = ???
8+
9+
class C1 given (x: TC)
10+
class C2 given (@unchecked x: TC)
11+
class C3 given (val x: TC)
12+
class C4 given (var x: TC)
13+
class C5 given (private val x: TC)
14+
class C6 given (private[this] val x: TC)
15+

0 commit comments

Comments
 (0)