mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Consistent terminology for attached/bound functions
This commit is contained in:
@@ -17,16 +17,16 @@ at contract level.
|
||||
The first part, ``A``, can be one of:
|
||||
|
||||
- a list of file-level or library functions (``using {f, g, h, L.t} for uint;``) -
|
||||
only those functions will be attached to the type.
|
||||
only those functions will be attached to the type as member functions
|
||||
- the name of a library (``using L for uint;``) -
|
||||
all functions (both public and internal ones) of the library are attached to the type
|
||||
all functions (both public and internal ones) of the library are attached to the type.
|
||||
|
||||
At file level, the second part, ``B``, has to be an explicit type (without data location specifier).
|
||||
Inside contracts, you can also use ``using L for *;``,
|
||||
which has the effect that all functions of the library ``L``
|
||||
are attached to *all* types.
|
||||
|
||||
If you specify a library, *all* functions in the library are attached,
|
||||
If you specify a library, *all* functions in the library get attached,
|
||||
even those where the type of the first parameter does not
|
||||
match the type of the object. The type is checked at the
|
||||
point the function is called and function overload
|
||||
|
||||
@@ -312,7 +312,7 @@ errorDefinition:
|
||||
Semicolon;
|
||||
|
||||
/**
|
||||
* Using directive to bind library functions and free functions to types.
|
||||
* Using directive to attach library functions and free functions to types.
|
||||
* Can occur within contracts and libraries and at the file level.
|
||||
*/
|
||||
usingDirective: Using (identifierPath | (LBrace identifierPath (Comma identifierPath)* RBrace)) For (Mul | typeName) Global? Semicolon;
|
||||
|
||||
@@ -664,7 +664,7 @@ introduced type and ``V`` has to be a built-in value type (the "underlying type"
|
||||
``C.wrap`` is used to convert from the underlying type to the custom type. Similarly, the
|
||||
function ``C.unwrap`` is used to convert from the custom type to the underlying type.
|
||||
|
||||
The type ``C`` does not have any operators or bound member functions. In particular, even the
|
||||
The type ``C`` does not have any operators or attached member functions. In particular, even the
|
||||
operator ``==`` is not defined. Explicit and implicit conversions to and from other types are
|
||||
disallowed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user