Skip to content

Commit 8de03c8

Browse files
Deprecation warning for send and transfer member functions
1 parent e0aed72 commit 8de03c8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

libsolidity/analysis/TypeChecker.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,6 +3223,20 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
32233223
if (contractType && contractType->isSuper())
32243224
requiredLookup = VirtualLookup::Super;
32253225
}
3226+
3227+
if (
3228+
funType->kind() == FunctionType::Kind::Send ||
3229+
funType->kind() == FunctionType::Kind::Transfer
3230+
)
3231+
m_errorReporter.warning(
3232+
9207_error,
3233+
_memberAccess.location(),
3234+
fmt::format(
3235+
"'{}' is deprecated and scheduled for removal in the next breaking version (0.9). "
3236+
"Use 'call{{value: <amount>}}(\"\")' instead.",
3237+
funType->kind() == FunctionType::Kind::Send ? "send" : "transfer"
3238+
)
3239+
);
32263240
}
32273241

32283242
annotation.requiredLookup = requiredLookup;

0 commit comments

Comments
 (0)