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 @@ -836,19 +836,23 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
836
836
tree.select(defn.Boolean_|| ).appliedTo(that)
837
837
838
838
/** 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.
840
840
*/
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
+ }
845
848
val qual = tree match {
846
849
case id : Ident => desugarIdentPrefix(id)
847
850
case Select (qual, _) => qual
848
851
}
849
852
qual.select(setter).appliedTo(rhs)
850
853
}
851
854
else Assign (tree, rhs)
855
+ }
852
856
853
857
/** A synthetic select with that will be turned into an outer path by ExplicitOuter.
854
858
* @param levels How many outer levels to select
You can’t perform that action at this time.
0 commit comments