View source code
Display the source code in dmd/mtype.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Class dmd.mtype.TypeFunction
Methods
Name | Description |
---|---|
attributesEqual
(other)
|
|
callMatch
(tthis, args, flag, pMessage, sc)
|
'args' are being matched to function 'this' Determine match level. |
constConv
(to)
|
Extends TypeNext.constConv by also checking for matching attributes |
hasLazyParameters
()
|
Return true if there are lazy parameters. |
incomplete
()
|
set or get if the return type or the default arguments are removed |
isctor
()
|
set or get if the function is a constructor |
isDstyleVariadic
()
|
Check for extern (D) U func(T t, ...) variadic function type,
which has _arguments[] added as the first argument.
|
isInOutParam
()
|
set or get if the function has the inout on the parameters
|
isInOutQual
()
|
set or get if the function has the inout on the parameters
|
islive
()
|
set or get if the function has the @live attribute
|
isnogc
()
|
set or get if the function has the @nogc attribute
|
isnothrow
()
|
set or get if the function has the nothrow attribute
|
isproperty
()
|
set or get if the function has the @property attribute
|
isref
()
|
set or get if the function has the ref attribute
|
isreturn
()
|
set or get if the function has the return attribute
|
isreturninferred
()
|
set or get if the function has the return attribute inferred
|
isscopeinferred
()
|
set or get if the function has the scope attribute inferred
|
isscopeinferred
(v)
|
ditoo |
isScopeQual
()
|
set or get if the function has the scope attribute
|
iswild
()
|
|
parameterEscapes
(tthis, p)
|
Examine function signature for parameter p and see if the value of p can 'escape' the scope of the function. This is useful to minimize the needed annotations for the parameters. |
parameterStorageClass
(tthis, p)
|
Take the specified storage class for p, and use the function signature to infer whether STC.scope_ and STC.return_ should be OR'd in. (This will not affect the name mangling.) |
purityLevel
()
|
Set 'purity' field of 'this'. Do this lazily, as the parameter types might be forward referenced. |
accept
(v)
|
Visits this AST node using the given visitor. |
addMod
(mod)
|
Add MODxxxx bits to existing type. We're adding, not replacing, so adding const to a shared type => "shared const" |
addSTC
(stc)
|
Apply STCxxxx bits to existing type. Use *before* semantic analysis is run. |
addStorageClass
(stc)
|
Add storage class modifiers to type. |
alignment
()
|
Return alignment to use for this type. |
baseElemOf
()
|
If this is a type of static array, return its base element type. |
castMod
(mod)
|
Apply MODxxxx bits to existing type. |
check
()
|
Look for bugs in constructing types. |
checkComplexTransition
(loc, sc)
|
|
checkDeprecated
(loc, sc)
|
Check type to see if it is based on a deprecated symbol. |
constOf
()
|
Convert to 'const'. |
covariant
(t, pstc)
|
Covariant means that 'this' can substitute for 't', i.e. a pure function is a match for an impure type. |
deduceWild
(t, isRef)
|
Compute MOD bits matching this argument type to wild parameter type.
|
defaultInitLiteral
(loc)
|
Use when we prefer the default initializer to be a literal, rather than a global immutable variable. |
deinitialize
()
|
Deinitializes the global state of the compiler. |
factory
(classname)
|
Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor. |
fixTo
(t)
|
For our new type 'this', which is type-constructed from t, fill in the cto, ito, sto, scto, wto shortcuts. |
getUniqueID
()
|
Returns a non-zero unique ID for this Type, or returns 0 if the Type does not (yet) have a unique ID.
If semantic() has not been run, 0 is returned.
|
hasInvariant
()
|
|
hasPointers
()
|
Return !=0 if type has pointers that need to be scanned by the GC during a collection cycle. |
hasVoidInitPointers
()
|
Detect if type has pointer fields that are initialized to void. Local stack variables with such void fields can remain uninitialized, leading to pointer bugs. |
hasWild
()
|
Return !=0 if the type or any of its subtypes is wild. |
immutableOf
()
|
Convert to 'immutable'. |
implicitConvTo
(to)
|
Determine if 'this' can be implicitly converted to type 'to'. |
isAssignable
()
|
When T is mutable, |
isBoolean
()
|
Returns true if T can be converted to boolean value. |
isFunction_Delegate_PtrToFunction
()
|
Is this type a function, delegate, or pointer to a function? |
isPtrToFunction
()
|
Is this type a pointer to a function? |
merge2
()
|
This version does a merge even if the deco is already computed. Necessary for types that have a deco, but are not merged. |
modToBuffer
(buf)
|
Store this type's modifier name into buf. |
modToChars
()
|
Return this type's modifier name. |
mutableOf
()
|
Make type mutable. |
needsCopyOrPostblit
()
|
true if when type is copied, it needs a copy constructor or postblit applied. Only applies to value types, not ref types. |
needsDestruction
()
|
true if when type goes out of scope, it needs a destructor applied. Only applies to value types, not ref types. |
needsNested
()
|
|
nextOf
()
|
For TypeFunction, nextOf() can return NULL if the function return type is meant to be inferred, and semantic() hasn't yet ben run on the function. After semantic(), it must no longer be NULL. |
nullAttributes
()
|
Return a copy of this type with all attributes null-initialized. Useful for creating a type with different modifiers. |
numberOfElems
(loc)
|
Compute number of elements for a (possibly multidimensional) static array, or 1 for other types. |
opCmp
(o)
|
Compare with another Object obj. |
opEquals
(o)
|
Test whether this is equal to o .
The default implementation only compares by identity (using the is operator).
Generally, overrides and overloads for opEquals should attempt to compare objects by their contents.
A class will most likely want to add an overload that takes your specific type as the argument
and does the content comparison. Then you can override this and forward it to your specific
typed overload with a cast. Remember to check for null on the typed overload.
|
sizemask
()
|
Return the mask that an integral type will fit into. |
toBasetype
()
|
If this is a shell around another type, get that other type. |
toChars
()
|
For pretty-printing a type. |
toHash
()
|
Compute hash function for Object. |
toHeadMutable
()
|
Return type with the top level of it being mutable. |
toPrettyChars
(QualifyTypes)
|
For pretty-printing a type. |
toString
()
|
|
toString
()
|
Convert Object to a human readable string. |
unSharedOf
()
|
Make type unshared. 0 => 0 const => const immutable => immutable shared => 0 shared const => const wild => wild wild const => wild const shared wild => wild shared wild const => wild const |
wildOf
()
|
Convert to 'wild'. |
Authors
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.