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 @@ -836,19 +836,23 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
836836 tree.select(defn.Boolean_|| ).appliedTo(that)
837837
838838 /** The translation of `tree = rhs`.
839- * This is either the tree as an assignment, to a setter call.
839+ * This is either the tree as an assignment, or a setter call.
840840 */
841- def becomes (rhs : Tree )(implicit ctx : Context ): Tree =
842- if (tree.symbol is Method ) {
843- val setter = tree.symbol.setter
844- assert(setter.exists, tree.symbol.showLocated)
841+ def becomes (rhs : Tree )(implicit ctx : Context ): Tree = {
842+ val sym = tree.symbol
843+ if (sym is Method ) {
844+ val setter = sym.setter.orElse {
845+ assert(sym.name.isSetterName && sym.info.firstParamTypes.nonEmpty)
846+ sym
847+ }
845848 val qual = tree match {
846849 case id : Ident => desugarIdentPrefix(id)
847850 case Select (qual, _) => qual
848851 }
849852 qual.select(setter).appliedTo(rhs)
850853 }
851854 else Assign (tree, rhs)
855+ }
852856
853857 /** A synthetic select with that will be turned into an outer path by ExplicitOuter.
854858 * @param levels How many outer levels to select
You can’t perform that action at this time.
0 commit comments