From c61d5b457ef141ae1de09cd0c845e96a7f05d316 Mon Sep 17 00:00:00 2001 From: wechman Date: Tue, 2 Aug 2022 11:17:58 +0200 Subject: [PATCH] Update UsingForDirective docstring --- libsolidity/ast/AST.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 2911a0a0c..a911186ab 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -649,11 +649,15 @@ private: * 2. `using LibraryName for *` attaches to all types. * 3. `using {f1, f2, ..., fn} for T` attaches the functions `f1`, `f2`, ..., * `fn`, respectively to `T`. + * 4. `using {f1 as op1, f2 as op2, ..., fn as opn} for T` bounds operator `opn` to function `fn` for type `T`. * * For version 3, T has to be implicitly convertible to the first parameter type of * all functions, and this is checked at the point of the using statement. For versions 1 and * 2, this check is only done when a function is called. * + * For version 4, T has to be user-defined value type or struct. All parameters and + * return value of all the functions has to be of type T. + * * Finally, `using {f1, f2, ..., fn} for T global` is also valid at file level, as long as T is * a user-defined type defined in the same file at file level. In this case, the methods are * attached to all objects of that type regardless of scope.