Skip to content

Commit

Permalink
Disallow spread member and null-safe member operators on method refer…
Browse files Browse the repository at this point in the history
…ences for M2
  • Loading branch information
tombentley committed Mar 15, 2012
1 parent becd3e9 commit b8a2ad5
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3239,6 +3239,21 @@ else if (p.isCovariant()) {
if (that.getTypeModel()==null) { if (that.getTypeModel()==null) {
that.setTypeModel( defaultType() ); that.setTypeModel( defaultType() );
} }
if (that instanceof Tree.Expression) {
Tree.Expression expr = (Tree.Expression)that;
Tree.Term term = expr.getTerm();
if (term instanceof Tree.QualifiedMemberOrTypeExpression) {
Tree.QualifiedMemberOrTypeExpression qme = (Tree.QualifiedMemberOrTypeExpression)term;
if (qme.getMemberOperator() instanceof Tree.SpreadOp
&& qme.getTypeModel().getDeclaration().getQualifiedNameString().equals("ceylon.language.Callable")) {
that.addWarning("spread method references not supported yet");
}
if (qme.getMemberOperator() instanceof Tree.SafeMemberOp
&& qme.getTypeModel().getDeclaration().getQualifiedNameString().equals("ceylon.language.Callable")) {
that.addWarning("null-safe method references not supported yet");
}
}
}
} }


@Override public void visit(Tree.Type that) { @Override public void visit(Tree.Type that) {
Expand Down

0 comments on commit b8a2ad5

Please sign in to comment.