Skip to content

Commit 92c08b3

Browse files
committed
Don't copy function flags to the parameters
1 parent 5a89d83 commit 92c08b3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,15 +1911,12 @@ object desugar {
19111911
/** Make erased function definitions use only ValDefs */
19121912
def makeErasedFunctionValDefs(tree: Function, pt: Type)(using Context): Function = {
19131913
val Function(args, result) = tree
1914-
val flags = tree match
1915-
case tree: FunctionWithMods => tree.mods.flags
1916-
case _ => EmptyFlags
19171914
args match {
19181915
case (_ : ValDef) :: _ => tree // ValDef case can be easily handled
19191916
case _ if !ctx.mode.is(Mode.Type) => tree
19201917
case _ =>
19211918
val applyVParams = args.zipWithIndex.map {
1922-
case (p, n) => makeSyntheticParameter(n + 1, p).withAddedFlags(flags)
1919+
case (p, n) => makeSyntheticParameter(n + 1, p)
19231920
}
19241921
tree match
19251922
case tree: FunctionWithMods =>

0 commit comments

Comments
 (0)