Skip to content

Commit 796408a

Browse files
Deprecation warning for send and transfer member functions
1 parent 3c584c1 commit 796408a

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
@@ -3222,6 +3222,20 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
32223222
if (contractType && contractType->isSuper())
32233223
requiredLookup = VirtualLookup::Super;
32243224
}
3225+
3226+
if (
3227+
funType->kind() == FunctionType::Kind::Send ||
3228+
funType->kind() == FunctionType::Kind::Transfer
3229+
)
3230+
m_errorReporter.warning(
3231+
9207_error,
3232+
_memberAccess.location(),
3233+
fmt::format(
3234+
"'{}' is deprecated and scheduled for removal in the next breaking version (0.9). "
3235+
"It is encouraged to use 'call{{value: <amount>}}()' instead.",
3236+
funType->kind() == FunctionType::Kind::Send ? "send" : "transfer"
3237+
)
3238+
);
32253239
}
32263240

32273241
annotation.requiredLookup = requiredLookup;

0 commit comments

Comments
 (0)