File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -839,19 +839,23 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
839839 tree.select(defn.Boolean_|| ).appliedTo(that)
840840
841841 /** The translation of `tree = rhs`.
842- * This is either the tree as an assignment, to a setter call.
842+ * This is either the tree as an assignment, or a setter call.
843843 */
844- def becomes (rhs : Tree )(implicit ctx : Context ): Tree =
845- if (tree.symbol is Method ) {
846- val setter = tree.symbol.setter
847- assert(setter.exists, tree.symbol.showLocated)
844+ def becomes (rhs : Tree )(implicit ctx : Context ): Tree = {
845+ val sym = tree.symbol
846+ if (sym is Method ) {
847+ val setter = sym.setter.orElse {
848+ assert(sym.name.isSetterName && sym.info.firstParamTypes.nonEmpty)
849+ sym
850+ }
848851 val qual = tree match {
849852 case id : Ident => desugarIdentPrefix(id)
850853 case Select (qual, _) => qual
851854 }
852855 qual.select(setter).appliedTo(rhs)
853856 }
854857 else Assign (tree, rhs)
858+ }
855859
856860 /** A synthetic select with that will be turned into an outer path by ExplicitOuter.
857861 * @param levels How many outer levels to select
You can’t perform that action at this time.
0 commit comments