File tree 1 file changed +9
-5
lines changed
compiler/src/dotty/tools/dotc/ast 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 {
839
839
tree.select(defn.Boolean_|| ).appliedTo(that)
840
840
841
841
/** 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.
843
843
*/
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
+ }
848
851
val qual = tree match {
849
852
case id : Ident => desugarIdentPrefix(id)
850
853
case Select (qual, _) => qual
851
854
}
852
855
qual.select(setter).appliedTo(rhs)
853
856
}
854
857
else Assign (tree, rhs)
858
+ }
855
859
856
860
/** A synthetic select with that will be turned into an outer path by ExplicitOuter.
857
861
* @param levels How many outer levels to select
You can’t perform that action at this time.
0 commit comments