A local definition of a method

Introduced properties

private var _constant_value: nullable Object

nitc :: MMethodDef :: _constant_value

An optional constant value returned in functions.
private var _initializers: Array[MProperty]

nitc :: MMethodDef :: _initializers

List of initialisers to call in root-inits
private var _is_abstract: Bool

nitc :: MMethodDef :: _is_abstract

Is the method definition abstract?
private var _is_calling_init: Bool

nitc :: MMethodDef :: _is_calling_init

Does the method take the responsibility to call init?
private var _is_extern: Bool

nitc :: MMethodDef :: _is_extern

Is the method definition extern?
private var _is_intern: Bool

nitc :: MMethodDef :: _is_intern

Is the method definition intern?
private var _is_old_style_init: Bool

nitc :: MMethodDef :: _is_old_style_init

Does the method is a old_style_init?
private var _msignature: nullable MSignature

nitc :: MMethodDef :: _msignature

The signature attached to the property definition
fun callref_thunk(recv_mtype: MClassType): SeparateThunkFunction

nitc :: MMethodDef :: callref_thunk

The C thunk function associated to a mmethoddef. Receives only nullable
private fun callref_thunk_cache=(callref_thunk_cache: nullable SeparateThunkFunction)

nitc :: MMethodDef :: callref_thunk_cache=

fun can_inline(v: VISITOR): Bool

nitc :: MMethodDef :: can_inline

Can the body be inlined?
private fun check_contract_facet(v: ContractsVisitor, n_signature: ASignature, classdef: MClassDef, mcontract: MContract, exist_contract: Bool)

nitc :: MMethodDef :: check_contract_facet

Verification of the contract facet
private fun check_same_contract(v: ContractsVisitor, n_annotation: AAnnotation, mcontract: MContract): Bool

nitc :: MMethodDef :: check_same_contract

Is the contract already defined in the context
protected fun class_call=(class_call: Counter[MClassType])

nitc :: MMethodDef :: class_call=

fun cname: String

nitc :: MMethodDef :: cname

Name of the function to callback this method from C,
private fun compile_foreign_code_entry(ecc: CCompilationUnit)

nitc :: MMethodDef :: compile_foreign_code_entry

Compile the standardized entry point as part of the foreign lib API
fun compile_inside_to_c(v: VISITOR, arguments: Array[RuntimeVariable]): nullable RuntimeVariable

nitc :: MMethodDef :: compile_inside_to_c

Inline the body in another visitor
fun compile_inside_to_java(v: JavaCompilerVisitor)

nitc :: MMethodDef :: compile_inside_to_java

Compile the body of this function
fun compile_parameter_check(v: VISITOR, arguments: Array[RuntimeVariable])

nitc :: MMethodDef :: compile_parameter_check

Generate type checks in the C code to check covariant parameters
fun compile_to_java(v: JavaCompilerVisitor)

nitc :: MMethodDef :: compile_to_java

Generate a Java RTMethod for self
fun constant_value: nullable Object

nitc :: MMethodDef :: constant_value

An optional constant value returned in functions.
fun constant_value=(constant_value: nullable Object)

nitc :: MMethodDef :: constant_value=

An optional constant value returned in functions.
private fun construct_contract(v: ContractsVisitor, n_signature: ASignature, n_annotation: AAnnotation, mcontract: MContract, exist_contract: Bool)

nitc :: MMethodDef :: construct_contract

Entry point to build contract (define the contract facet and define the contract method verification)
private fun create_contract_facet(v: ContractsVisitor, classdef: MClassDef, n_signature: ASignature): AMethPropdef

nitc :: MMethodDef :: create_contract_facet

Method to create a contract facet of the method
init defaultinit(mclassdef: MClassDef, mproperty: MPROPERTY, location: Location)

nitc :: MMethodDef :: defaultinit

fun foreign_lib_entry_cname: String

nitc :: MMethodDef :: foreign_lib_entry_cname

Name of the entry point to the implementation function in the foreign lib
fun initializers: Array[MProperty]

nitc :: MMethodDef :: initializers

List of initialisers to call in root-inits
protected fun initializers=(initializers: Array[MProperty])

nitc :: MMethodDef :: initializers=

List of initialisers to call in root-inits
fun is_abstract: Bool

nitc :: MMethodDef :: is_abstract

Is the method definition abstract?
fun is_abstract=(is_abstract: Bool)

nitc :: MMethodDef :: is_abstract=

Is the method definition abstract?
fun is_calling_init: Bool

nitc :: MMethodDef :: is_calling_init

Does the method take the responsibility to call init?
fun is_calling_init=(is_calling_init: Bool)

nitc :: MMethodDef :: is_calling_init=

Does the method take the responsibility to call init?
fun is_extern: Bool

nitc :: MMethodDef :: is_extern

Is the method definition extern?
fun is_extern=(is_extern: Bool)

nitc :: MMethodDef :: is_extern=

Is the method definition extern?
fun is_intern: Bool

nitc :: MMethodDef :: is_intern

Is the method definition intern?
fun is_intern=(is_intern: Bool)

nitc :: MMethodDef :: is_intern=

Is the method definition intern?
fun is_old_style_init: Bool

nitc :: MMethodDef :: is_old_style_init

Does the method is a old_style_init?
fun is_old_style_init=(is_old_style_init: Bool)

nitc :: MMethodDef :: is_old_style_init=

Does the method is a old_style_init?
protected fun line_number=(line_number: Int)

nitc :: MMethodDef :: line_number=

fun msignature: nullable MSignature

nitc :: MMethodDef :: msignature

The signature attached to the property definition
fun msignature=(msignature: nullable MSignature)

nitc :: MMethodDef :: msignature=

The signature attached to the property definition
private fun no_intro_contract(v: ContractsVisitor, n_signature: ASignature, mcontract: MContract, n_annotation: AAnnotation)

nitc :: MMethodDef :: no_intro_contract

Create a contract on the introduction classdef of the property.
fun recv_differ_from_intro: Bool

nitc :: MMethodDef :: recv_differ_from_intro

Returns true if the current method definition differ from
private fun rt_name: String

nitc :: MMethodDef :: rt_name

Runtime name
fun separate_runtime_function: SeparateRuntimeFunction

nitc :: MMethodDef :: separate_runtime_function

The C function associated to a mmethoddef
private fun separate_runtime_function_cache=(separate_runtime_function_cache: nullable SeparateRuntimeFunction)

nitc :: MMethodDef :: separate_runtime_function_cache=

protected fun total_self_call=(total_self_call: Int)

nitc :: MMethodDef :: total_self_call=

fun virtual_runtime_function: SeparateRuntimeFunction

nitc :: MMethodDef :: virtual_runtime_function

The C function associated to a mmethoddef, that can be stored into a VFT of a class
private fun virtual_runtime_function_cache=(virtual_runtime_function_cache: nullable SeparateRuntimeFunction)

nitc :: MMethodDef :: virtual_runtime_function_cache=

Redefined properties

redef type MPROPDEF: MMethodDef

nitc $ MMethodDef :: MPROPDEF

Self class
redef type MPROPERTY: MMethod

nitc $ MMethodDef :: MPROPERTY

The associated MProperty subclass.
redef type SELF: MMethodDef

nitc $ MMethodDef :: SELF

Type of this instance, automatically specialized in every class
redef fun core_serialize_to(v: Serializer)

nitc :: json_model $ MMethodDef :: core_serialize_to

Actual serialization of self to serializer
redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AMethPropdef

nitc :: astbuilder $ MMethodDef :: create_ast_representation

Build a ANode from self
redef fun cs_signature(no_color: nullable Bool): String

nitc :: term_model $ MMethodDef :: cs_signature

Returns self signature formatted for console.
redef fun html_signature(short: nullable Bool): Template

nitc :: html_model $ MMethodDef :: html_signature

Returns the MEntity signature decorated with HTML
redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: neo $ MMethodDef :: to_node

Build a NeoNode representing self.
redef fun tpl_module(model: UMLModel): Writable

nitc :: uml_module $ MMethodDef :: tpl_module

Builds a dot UML package diagram entity from self
redef fun write_location(mainmodule: MModule, stream: Writer)

nitc :: vim_autocomplete $ MMethodDef :: write_location

Location (file and line when available) of related declarations

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type MENTITY: SELF

nitc :: MEntity :: MENTITY

FIXME used to bypass RTA limitation on type resolution
type MPROPDEF: MPropDef

nitc :: MPropDef :: MPROPDEF

Self class
type MPROPERTY: MProperty

nitc :: MPropDef :: MPROPERTY

The associated MProperty subclass.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _annotations: Set[String]

nitc :: AnnotatedMEntity :: _annotations

Names of the annotations found on self declaration
private var _c_name: String

nitc :: MPropDef :: _c_name

private var _constant_value: nullable Object

nitc :: MMethodDef :: _constant_value

An optional constant value returned in functions.
private var _css_classes: Array[String]

nitc :: MEntity :: _css_classes

CSS classes used to decorate self
private var _deprecation: nullable MDeprecationInfo

nitc :: MEntity :: _deprecation

Is the entity deprecated?
private var _examples: Array[MExample]

nitc :: MEntity :: _examples

Examples found for self
private var _full_name: String

nitc :: MPropDef :: _full_name

The full-name of mpropdefs combine the information about the classdef and the mproperty.
private var _has_contract: Bool

nitc :: MPropDef :: _has_contract

flag to indicate is the MPropDef has a contract
private var _has_supercall: Bool

nitc :: MPropDef :: _has_supercall

Does the MPropDef contains a call to super or a call of a super-constructor?
private var _html_full_name: String

nitc :: MEntity :: _html_full_name

The MEntity full_name escaped for HTML
private var _html_id: String

nitc :: MEntity :: _html_id

The MEntity unique ID in the HTML output
private var _html_name: String

nitc :: MEntity :: _html_name

The MEntity name escaped for HTML
private var _html_url: String

nitc :: MEntity :: _html_url

private var _html_url: String

nitc :: MEntity :: _html_url

The MEntity URL in the HTML output
private var _html_url: String

nitc :: MPropDef :: _html_url

private var _initializers: Array[MProperty]

nitc :: MMethodDef :: _initializers

List of initialisers to call in root-inits
private var _is_abstract: Bool

nitc :: MMethodDef :: _is_abstract

Is the method definition abstract?
private var _is_after: Bool

nitc :: MPropDef :: _is_after

private var _is_after: Bool

nitc :: MPropDef :: _is_after

Does self have the after annotation?
private var _is_after_all: Bool

nitc :: MPropDef :: _is_after_all

Does self have the after_all annotation?
private var _is_before: Bool

nitc :: MPropDef :: _is_before

private var _is_before: Bool

nitc :: MPropDef :: _is_before

Does self have the before annotation?
private var _is_before_all: Bool

nitc :: MPropDef :: _is_before_all

Does self have the before_all annotation?
private var _is_broken: Bool

nitc :: MEntity :: _is_broken

The indication that the entity did not pass some semantic verifications.
private var _is_calling_init: Bool

nitc :: MMethodDef :: _is_calling_init

Does the method take the responsibility to call init?
private var _is_extern: Bool

nitc :: MMethodDef :: _is_extern

Is the method definition extern?
private var _is_fictive: Bool

nitc :: MEntity :: _is_fictive

Is self created for internal purpose?
private var _is_intern: Bool

nitc :: MMethodDef :: _is_intern

Is the method definition intern?
private var _is_old_style_init: Bool

nitc :: MMethodDef :: _is_old_style_init

Does the method is a old_style_init?
private var _is_test: Bool

nitc :: MEntity :: _is_test

Is self created for unit testing purpose?
private var _is_test: Bool

nitc :: MPropDef :: _is_test

private var _location: Location

nitc :: MPropDef :: _location

private var _mclassdef: MClassDef

nitc :: MPropDef :: _mclassdef

The class definition where the property definition is
private var _mdoc: nullable MDoc

nitc :: MEntity :: _mdoc

The documentation associated to the entity
private var _mexample: nullable MExample

nitc :: MEntity :: _mexample

Return this entity as a MExample
private var _mproperty: MPROPERTY

nitc :: MPropDef :: _mproperty

The associated global property
private var _msignature: nullable MSignature

nitc :: MMethodDef :: _msignature

The signature attached to the property definition
private var _to_s: String

nitc :: MPropDef :: _to_s

Internal name combining the module, the class and the property
protected fun accept_json_serializer(v: JsonSerializer)

serialization :: Serializable :: accept_json_serializer

Refinable service to customize the serialization of this class to JSON
protected fun accept_msgpack_attribute_counter(v: AttributeCounter)

serialization :: Serializable :: accept_msgpack_attribute_counter

Hook to customize the behavior of the AttributeCounter
protected fun accept_msgpack_serializer(v: MsgPackSerializer)

serialization :: Serializable :: accept_msgpack_serializer

Hook to customize the serialization of this class to MessagePack
private fun add_doc_to_infobox(res: HInfoBox)

nitc :: MEntity :: add_doc_to_infobox

Append an entry for the doc in the given infobox
protected fun add_to_bundle(bundle: NativeBundle, key: JavaString)

serialization :: Serializable :: add_to_bundle

Called by []= to dynamically choose the appropriate method according
fun annotations: Set[String]

nitc :: AnnotatedMEntity :: annotations

Names of the annotations found on self declaration
protected fun annotations=(annotations: Set[String])

nitc :: AnnotatedMEntity :: annotations=

Names of the annotations found on self declaration
fun api_url: String

nitc :: MEntity :: api_url

URL to self within the JSON api.
abstract fun c_name: String

nitc :: MEntity :: c_name

A fully-qualified C-like identifier of this model entity.
protected fun c_name=(c_name: String)

nitc :: MPropDef :: c_name=

fun callref_thunk(recv_mtype: MClassType): SeparateThunkFunction

nitc :: MMethodDef :: callref_thunk

The C thunk function associated to a mmethoddef. Receives only nullable
private fun callref_thunk_cache=(callref_thunk_cache: nullable SeparateThunkFunction)

nitc :: MMethodDef :: callref_thunk_cache=

fun can_inline(v: VISITOR): Bool

nitc :: MMethodDef :: can_inline

Can the body be inlined?
private fun check_contract_facet(v: ContractsVisitor, n_signature: ASignature, classdef: MClassDef, mcontract: MContract, exist_contract: Bool)

nitc :: MMethodDef :: check_contract_facet

Verification of the contract facet
private fun check_same_contract(v: ContractsVisitor, n_annotation: AAnnotation, mcontract: MContract): Bool

nitc :: MMethodDef :: check_same_contract

Is the contract already defined in the context
protected fun class_call=(class_call: Counter[MClassType])

nitc :: MMethodDef :: class_call=

protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun cname: String

nitc :: MMethodDef :: cname

Name of the function to callback this method from C,
fun collect_ancestors(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_ancestors

Collect self ancestors (direct and indirect)
abstract fun collect_children(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_children

Collect self children (direct descendants)
fun collect_descendants(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_descendants

Collect self descendants (direct and direct)
fun collect_linearization(mainmodule: MModule): nullable Array[MEntity]

nitc :: MEntity :: collect_linearization

Collect self linearization anchored on mainmodule
fun collect_modifiers: Array[String]

nitc :: MEntity :: collect_modifiers

Collect modifier keywords like redef, private etc
abstract fun collect_parents(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_parents

Collect self parents (direct ancestors)
fun color: String

nitc :: MEntity :: color

private fun compile_foreign_code_entry(ecc: CCompilationUnit)

nitc :: MMethodDef :: compile_foreign_code_entry

Compile the standardized entry point as part of the foreign lib API
fun compile_inside_to_c(v: VISITOR, arguments: Array[RuntimeVariable]): nullable RuntimeVariable

nitc :: MMethodDef :: compile_inside_to_c

Inline the body in another visitor
fun compile_inside_to_java(v: JavaCompilerVisitor)

nitc :: MMethodDef :: compile_inside_to_java

Compile the body of this function
fun compile_parameter_check(v: VISITOR, arguments: Array[RuntimeVariable])

nitc :: MMethodDef :: compile_parameter_check

Generate type checks in the C code to check covariant parameters
fun compile_to_java(v: JavaCompilerVisitor)

nitc :: MMethodDef :: compile_to_java

Generate a Java RTMethod for self
private fun complete_mdoc: nullable MDoc

nitc :: MEntity :: complete_mdoc

Doc to use in completion
private fun complete_name: String

nitc :: MEntity :: complete_name

Actual name used in completion
protected fun const_color=(const_color: String)

nitc :: MEntity :: const_color=

fun constant_value: nullable Object

nitc :: MMethodDef :: constant_value

An optional constant value returned in functions.
fun constant_value=(constant_value: nullable Object)

nitc :: MMethodDef :: constant_value=

An optional constant value returned in functions.
private fun construct_contract(v: ContractsVisitor, n_signature: ASignature, n_annotation: AAnnotation, mcontract: MContract, exist_contract: Bool)

nitc :: MMethodDef :: construct_contract

Entry point to build contract (define the contract facet and define the contract method verification)
fun core_serialize_to(serializer: Serializer)

serialization :: Serializable :: core_serialize_to

Actual serialization of self to serializer
abstract fun create_ast_representation(astbuilder: nullable ASTBuilder): ANode

nitc :: MEntity :: create_ast_representation

Build a ANode from self
private fun create_contract_facet(v: ContractsVisitor, classdef: MClassDef, n_signature: ASignature): AMethPropdef

nitc :: MMethodDef :: create_contract_facet

Method to create a contract facet of the method
fun cs_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_comment

Returns the comment of this MEntity formatted for console.
fun cs_declaration(no_color: nullable Bool): String

nitc :: MEntity :: cs_declaration

Returns the complete MEntity declaration (modifiers + name + signature).
fun cs_full_name(no_color: nullable Bool): String

nitc :: MEntity :: cs_full_name

Returns self.full_name formatted for console
fun cs_icon(no_color: nullable Bool): String

nitc :: MEntity :: cs_icon

Text icon to be displayed in front of the entity
fun cs_list_item(no_color: nullable Bool): String

nitc :: MEntity :: cs_list_item

Returns self as a list element that can be displayed in console.
fun cs_location(no_color: nullable Bool): String

nitc :: MEntity :: cs_location

Source code location of this MEntity formatted for console
fun cs_short_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_short_comment

Returns the comment of this MEntity formatted for console.
fun cs_signature(no_color: nullable Bool): String

nitc :: MEntity :: cs_signature

Returns self signature formatted for console.
fun cs_source_code: String

nitc :: MEntity :: cs_source_code

Source code associated to this MEntity.
fun css_classes: Array[String]

nitc :: MEntity :: css_classes

CSS classes used to decorate self
protected fun css_classes=(css_classes: Array[String])

nitc :: MEntity :: css_classes=

CSS classes used to decorate self
init defaultinit(mclassdef: MClassDef, mproperty: MPROPERTY, location: Location)

nitc :: MMethodDef :: defaultinit

init defaultinit(mclassdef: MClassDef, mproperty: MPROPERTY, location: Location)

nitc :: MPropDef :: defaultinit

fun deprecation: nullable MDeprecationInfo

nitc :: MEntity :: deprecation

Is the entity deprecated?
fun deprecation=(deprecation: nullable MDeprecationInfo)

nitc :: MEntity :: deprecation=

Is the entity deprecated?
fun examples: Array[MExample]

nitc :: MEntity :: examples

Examples found for self
protected fun examples=(examples: Array[MExample])

nitc :: MEntity :: examples=

Examples found for self
fun foreign_lib_entry_cname: String

nitc :: MMethodDef :: foreign_lib_entry_cname

Name of the entry point to the implementation function in the foreign lib
init from_deserializer(deserializer: Deserializer)

serialization :: Serializable :: from_deserializer

Create an instance of this class from the deserializer
abstract fun full_name: String

nitc :: MEntity :: full_name

A fully-qualified name of this model entity.
protected fun full_name=(full_name: String)

nitc :: MPropDef :: full_name=

The full-name of mpropdefs combine the information about the classdef and the mproperty.
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun has_annotation(annotation: String): Bool

nitc :: AnnotatedMEntity :: has_annotation

Does self contains annotation in its declaration?
fun has_contract: Bool

nitc :: MPropDef :: has_contract

flag to indicate is the MPropDef has a contract
protected fun has_contract=(has_contract: Bool)

nitc :: MPropDef :: has_contract=

flag to indicate is the MPropDef has a contract
fun has_supercall: Bool

nitc :: MPropDef :: has_supercall

Does the MPropDef contains a call to super or a call of a super-constructor?
fun has_supercall=(has_supercall: Bool)

nitc :: MPropDef :: has_supercall=

Does the MPropDef contains a call to super or a call of a super-constructor?
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun hierarchy_poset(mainmodule: MModule, filter: nullable ModelFilter): POSet[MENTITY]

nitc :: MEntity :: hierarchy_poset

Build a poset representing self in it's own hierarchy
private fun href(v: NitlightVisitor): nullable String

nitc :: MEntity :: href

fun html_declaration: Template

nitc :: MEntity :: html_declaration

Returns the complete MEntity declaration decorated with HTML
fun html_full_name: String

nitc :: MEntity :: html_full_name

The MEntity full_name escaped for HTML
protected fun html_full_name=(html_full_name: String)

nitc :: MEntity :: html_full_name=

The MEntity full_name escaped for HTML
fun html_icon: BSIcon

nitc :: MEntity :: html_icon

An icon representative of the mentity
fun html_id: String

nitc :: MEntity :: html_id

The MEntity unique ID in the HTML output
protected fun html_id=(html_id: String)

nitc :: MEntity :: html_id=

The MEntity unique ID in the HTML output
fun html_name: String

nitc :: MEntity :: html_name

The MEntity name escaped for HTML
protected fun html_name=(html_name: String)

nitc :: MEntity :: html_name=

The MEntity name escaped for HTML
abstract fun html_namespace: Template

nitc :: MEntity :: html_namespace

Returns full_name decorated with HTML links
fun html_signature(short: nullable Bool): Template

nitc :: MEntity :: html_signature

Returns the MEntity signature decorated with HTML
fun html_url: String

nitc :: MEntity :: html_url

The MEntity URL in the HTML output
protected fun html_url=(html_url: String)

nitc :: MEntity :: html_url=

The MEntity URL in the HTML output
abstract fun infobox(v: HtmlightVisitor): HInfoBox

nitc :: HInfoBoxable :: infobox

An new infobox documenting the entity
init init

core :: Object :: init

fun initializers: Array[MProperty]

nitc :: MMethodDef :: initializers

List of initialisers to call in root-inits
protected fun initializers=(initializers: Array[MProperty])

nitc :: MMethodDef :: initializers=

List of initialisers to call in root-inits
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun is_abstract: Bool

nitc :: MMethodDef :: is_abstract

Is the method definition abstract?
fun is_abstract=(is_abstract: Bool)

nitc :: MMethodDef :: is_abstract=

Is the method definition abstract?
fun is_after: Bool

nitc :: MPropDef :: is_after

Does self have the after annotation?
fun is_after=(is_after: Bool)

nitc :: MPropDef :: is_after=

Does self have the after annotation?
fun is_after_all: Bool

nitc :: MPropDef :: is_after_all

Does self have the after_all annotation?
fun is_after_all=(is_after_all: Bool)

nitc :: MPropDef :: is_after_all=

Does self have the after_all annotation?
fun is_before: Bool

nitc :: MPropDef :: is_before

Does self have the before annotation?
fun is_before=(is_before: Bool)

nitc :: MPropDef :: is_before=

Does self have the before annotation?
fun is_before_all: Bool

nitc :: MPropDef :: is_before_all

Does self have the before_all annotation?
fun is_before_all=(is_before_all: Bool)

nitc :: MPropDef :: is_before_all=

Does self have the before_all annotation?
fun is_broken: Bool

nitc :: MEntity :: is_broken

The indication that the entity did not pass some semantic verifications.
fun is_broken=(is_broken: Bool)

nitc :: MEntity :: is_broken=

The indication that the entity did not pass some semantic verifications.
fun is_calling_init: Bool

nitc :: MMethodDef :: is_calling_init

Does the method take the responsibility to call init?
fun is_calling_init=(is_calling_init: Bool)

nitc :: MMethodDef :: is_calling_init=

Does the method take the responsibility to call init?
fun is_example: Bool

nitc :: MEntity :: is_example

Is self existing for an example purpose?
fun is_extern: Bool

nitc :: MMethodDef :: is_extern

Is the method definition extern?
fun is_extern=(is_extern: Bool)

nitc :: MMethodDef :: is_extern=

Is the method definition extern?
fun is_fictive: Bool

nitc :: MEntity :: is_fictive

Is self created for internal purpose?
fun is_fictive=(is_fictive: Bool)

nitc :: MEntity :: is_fictive=

Is self created for internal purpose?
fun is_intern: Bool

nitc :: MMethodDef :: is_intern

Is the method definition intern?
fun is_intern=(is_intern: Bool)

nitc :: MMethodDef :: is_intern=

Is the method definition intern?
fun is_intro: Bool

nitc :: MPropDef :: is_intro

Is self the definition that introduce the property?
fun is_old_style_init: Bool

nitc :: MMethodDef :: is_old_style_init

Does the method is a old_style_init?
fun is_old_style_init=(is_old_style_init: Bool)

nitc :: MMethodDef :: is_old_style_init=

Does the method is a old_style_init?
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun is_test: Bool

nitc :: MEntity :: is_test

Is self created for unit testing purpose?
fun is_test=(is_test: Bool)

nitc :: MEntity :: is_test=

Is self created for unit testing purpose?
private fun jname: String

nitc :: MEntity :: jname

A Java compatible name for self
abstract fun json_namespace: JsonNamespace

nitc :: MEntity :: json_namespace

Return self.full_name as an object that can be serialized to json.
protected fun line_number=(line_number: Int)

nitc :: MMethodDef :: line_number=

fun linkto(v: HtmlightVisitor): HTMLTag

nitc :: MEntity :: linkto

A HTML version of to_s with hyper-links.
fun linkto_text(v: HtmlightVisitor, text: String): HTMLTag

nitc :: MEntity :: linkto_text

Link to the self with a specific text.
fun location: Location

nitc :: MEntity :: location

The origin of the definition.
protected fun location=(location: Location)

nitc :: MPropDef :: location=

fun lookup_next_definition(mmodule: MModule, mtype: MType): MPROPDEF

nitc :: MPropDef :: lookup_next_definition

Return the next definition in linearization of mtype.
private fun make_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: make_node

Make a new NeoNode based on mentity.
fun mclassdef: MClassDef

nitc :: MPropDef :: mclassdef

The class definition where the property definition is
protected fun mclassdef=(mclassdef: MClassDef)

nitc :: MPropDef :: mclassdef=

The class definition where the property definition is
fun mdoc: nullable MDoc

nitc :: MEntity :: mdoc

The documentation associated to the entity
fun mdoc=(mdoc: nullable MDoc)

nitc :: MEntity :: mdoc=

The documentation associated to the entity
fun mdoc_or_fallback: nullable MDoc

nitc :: MEntity :: mdoc_or_fallback

The documentation associated to the entity or their main nested entity.
private fun mentity_kind_rank: Int

nitc :: MEntity :: mentity_kind_rank

Compare MEntity class kind
fun mexample: nullable MExample

nitc :: MEntity :: mexample

Return this entity as a MExample
protected fun mexample=(mexample: nullable MExample)

nitc :: MEntity :: mexample=

Return this entity as a MExample
abstract fun model: Model

nitc :: MEntity :: model

A Model Entity has a direct link to its model
fun mproperty: MPROPERTY

nitc :: MPropDef :: mproperty

The associated global property
protected fun mproperty=(mproperty: MPROPERTY)

nitc :: MPropDef :: mproperty=

The associated global property
protected fun msgpack_extra_array_items: Int

serialization :: Serializable :: msgpack_extra_array_items

Hook to request a larger than usual metadata array
fun msignature: nullable MSignature

nitc :: MMethodDef :: msignature

The signature attached to the property definition
fun msignature=(msignature: nullable MSignature)

nitc :: MMethodDef :: msignature=

The signature attached to the property definition
abstract fun name: String

nitc :: MEntity :: name

The short (unqualified) name of this model entity.
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
abstract fun nitdoc_breadcrumbs: Array[MEntity]

nitc :: MEntity :: nitdoc_breadcrumbs

MEntities composing the breadcrumbs of a nitdoc page
protected fun nitdoc_breadcrumbs=(nitdoc_breadcrumbs: Array[MEntity])

nitc :: MPropDef :: nitdoc_breadcrumbs=

private fun no_intro_contract(v: ContractsVisitor, n_signature: ASignature, mcontract: MContract, n_annotation: AAnnotation)

nitc :: MMethodDef :: no_intro_contract

Create a contract on the introduction classdef of the property.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun ratings(config: NitwebConfig, user: nullable String): JsonObject

nitc :: MEntity :: ratings

Get the ratings of a mentity
fun ratings_by_dimension(config: NitwebConfig, dimension: String, user: nullable String): JsonObject

nitc :: MEntity :: ratings_by_dimension

Get the ratings of a dimension
fun recv_differ_from_intro: Bool

nitc :: MMethodDef :: recv_differ_from_intro

Returns true if the current method definition differ from
private fun rt_name: String

nitc :: MMethodDef :: rt_name

Runtime name
fun separate_runtime_function: SeparateRuntimeFunction

nitc :: MMethodDef :: separate_runtime_function

The C function associated to a mmethoddef
private fun separate_runtime_function_cache=(separate_runtime_function_cache: nullable SeparateRuntimeFunction)

nitc :: MMethodDef :: separate_runtime_function_cache=

fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun serialize_msgpack(plain: nullable Bool): Bytes

serialization :: Serializable :: serialize_msgpack

Serialize self to MessagePack bytes
fun serialize_to(serializer: Serializer)

serialization :: Serializable :: serialize_to

Serialize self to serializer
fun serialize_to_json(plain: nullable Bool, pretty: nullable Bool): String

serialization :: Serializable :: serialize_to_json

Serialize self to JSON
private fun serialize_to_or_delay(v: Serializer)

serialization :: Serializable :: serialize_to_or_delay

Accept references or force direct serialization (using serialize_to)
private fun source_url(url_pattern: nullable String): String

nitc :: MEntity :: source_url

Render a HTML link for the MEntity location
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_dot_node: DotNode

nitc :: MEntity :: to_dot_node

Return self as a DotNode
fun to_json: String

serialization :: Serializable :: to_json

Serialize self to plain JSON
fun to_json_ref: MEntityRef

nitc :: MEntity :: to_json_ref

Return a new MEntityRef to self.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

private fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: to_node

Build a NeoNode representing self.
fun to_pretty_json: String

serialization :: Serializable :: to_pretty_json

Serialize self to plain pretty JSON
fun to_s: String

core :: Object :: to_s

User readable representation of self.
protected fun to_s=(to_s: String)

nitc :: MPropDef :: to_s=

Internal name combining the module, the class and the property
protected fun total_self_call=(total_self_call: Int)

nitc :: MMethodDef :: total_self_call=

abstract fun tpl_class(model: UMLModel): Writable

nitc :: MEntity :: tpl_class

Generates a dot-compatible Writable UML Class diagram from self
abstract fun tpl_module(model: UMLModel): Writable

nitc :: MEntity :: tpl_module

Builds a dot UML package diagram entity from self
fun virtual_runtime_function: SeparateRuntimeFunction

nitc :: MMethodDef :: virtual_runtime_function

The C function associated to a mmethoddef, that can be stored into a VFT of a class
private fun virtual_runtime_function_cache=(virtual_runtime_function_cache: nullable SeparateRuntimeFunction)

nitc :: MMethodDef :: virtual_runtime_function_cache=

fun visibility: MVisibility

nitc :: MEntity :: visibility

The visibility of the MEntity.
fun visit_all(v: ModelVisitor)

nitc :: MEntity :: visit_all

Call v.enter_visit on all nested entities.
fun web_url: String

nitc :: MEntity :: web_url

URL to self within the web interface.
private fun write_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_doc

private fun write_extra_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_extra_doc

Extra auto documentation to append to the stream
private fun write_location(mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_location

Location (file and line when available) of related declarations
package_diagram nitc::MMethodDef MMethodDef nitc::MPropDef MPropDef nitc::MMethodDef->nitc::MPropDef nitc::java_compiler::TableCallable TableCallable nitc::MMethodDef->nitc::java_compiler::TableCallable nitc::MEntity MEntity nitc::MPropDef->nitc::MEntity nitc::AnnotatedMEntity AnnotatedMEntity nitc::MPropDef->nitc::AnnotatedMEntity nitc::PropertyLayoutElement PropertyLayoutElement nitc::MPropDef->nitc::PropertyLayoutElement core::Object Object nitc::java_compiler::TableCallable->core::Object ...nitc::MEntity ... ...nitc::MEntity->nitc::MEntity ...nitc::AnnotatedMEntity ... ...nitc::AnnotatedMEntity->nitc::AnnotatedMEntity ...nitc::PropertyLayoutElement ... ...nitc::PropertyLayoutElement->nitc::PropertyLayoutElement ...core::Object ... ...core::Object->core::Object

Ancestors

abstract class AnnotatedMEntity

nitc :: AnnotatedMEntity

A MEntity that can hold annotations from it's source code
interface HInfoBoxable

nitc :: HInfoBoxable

Model entity or whatever that can produce an infobox
abstract class MEntity

nitc :: MEntity

A named and possibly documented entity in the model.
interface Object

core :: Object

The root of the class hierarchy.
interface Serializable

serialization :: Serializable

Instances of this class can be passed to Serializer::serialize

Parents

abstract class MPropDef

nitc :: MPropDef

A definition of a property (local property)
private interface TableCallable

nitc :: TableCallable

Used as a common type between MMethod and MMethodDef for table_send

Class definitions

nitc $ MMethodDef
# A local definition of a method
class MMethodDef
	super MPropDef

	redef type MPROPERTY: MMethod
	redef type MPROPDEF: MMethodDef

	# The signature attached to the property definition
	var msignature: nullable MSignature = null is writable

	# List of initialisers to call in root-inits
	#
	# They could be setters or attributes
	var initializers = new Array[MProperty]

	# Does the method take the responsibility to call `init`?
	#
	# If the method is used as an initializer, then
	# using this information prevents to call `init` twice.
	var is_calling_init = false is writable

	# Does the method is a old_style_init?
	#
	var is_old_style_init = false is writable

	# Is the method definition abstract?
	var is_abstract: Bool = false is writable

	# Is the method definition intern?
	var is_intern = false is writable

	# Is the method definition extern?
	var is_extern = false is writable

	# An optional constant value returned in functions.
	#
	# Only some specific primitife value are accepted by engines.
	# Is used when there is no better implementation available.
	#
	# Currently used only for the implementation of the `--define`
	# command-line option.
	# SEE: module `mixin`.
	var constant_value: nullable Object = null is writable
end
src/model/model.nit:2650,1--2693,3

nitc :: nitni_base $ MMethodDef
redef class MMethodDef
	# Name of the function to callback this method from C,
	# also used in other functions names used for this method.
	fun cname: String do return "{mclassdef.mclass.name}_{mproperty.short_cname}"
end
src/nitni/nitni_base.nit:60,1--64,3

nitc :: neo $ MMethodDef
redef class MMethodDef
	redef fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
		if nodes.has_key(self) then return nodes[self]
		var node = super
		node["is_abstract"] = is_abstract
		node["is_intern"] = is_intern
		node["is_extern"] = is_extern
		var msignature = msignature
		if msignature != null then
			node.out_edges.add(new NeoEdge(node, "SIGNATURE", msignature.to_node(nodes, model_name)))
		end
		return node
	end
end
src/neo.nit:809,1--822,3

nitc :: on_demand_compiler $ MMethodDef
redef class MMethodDef
	# Name of the entry point to the implementation function in the foreign lib
	fun foreign_lib_entry_cname: String do return "entry__{cname}"

	# Compile the standardized entry point as part of the foreign lib API
	private fun compile_foreign_code_entry(ecc: CCompilationUnit)
	do
		var msignature = msignature
		if msignature == null then return

		# Return type
		var return_mtype = msignature.return_mtype
		if mproperty.is_init then return_mtype = mclassdef.mclass.mclass_type

		var c_return_type
		if return_mtype != null then
			c_return_type = return_mtype.cname_blind
		else c_return_type = "void"

		var is_init = mproperty.is_init

		# Params
		var params = new Array[String]
		if not is_init then params.add mclassdef.mclass.mclass_type.cname_blind
		for param in msignature.mparameters do params.add param.mtype.cname_blind

		# Declare the implementation function as extern
		var impl_cname = mproperty.build_cname(mclassdef.bound_mtype,
			mclassdef.mmodule, "___impl", long_signature)
		ecc.body_decl.add "extern {c_return_type} {impl_cname}({params.join(", ")});\n"

		# Declare the entry function
		var foreign_lib_entry_cname = "int {foreign_lib_entry_cname}(int argc, nit_call_arg *argv, nit_call_arg *result)"
		var fc = new CFunction(foreign_lib_entry_cname)

		# Check argument count on the library side
		#
		# This may detect inconsistencies between the interpreter and the generated code.
		var expected_argc = msignature.arity
		if not is_init then expected_argc += 1

		fc.exprs.add """
	if (argc != {{{expected_argc}}}) {
		printf("Invalid argument count in `{{{mproperty.full_name}}}`, expected %d, got %d.\\n",
			argc, {{{expected_argc}}});
		return 1;
	}
"""

		# Unpack and prepare args for the user code
		var k = 0
		var args_for_call = new Array[String]
		if not is_init then
			var mtype = mclassdef.mclass.mclass_type
			var arg_name = "arg___self"

			fc.decls.add "	{mtype.cname_blind} {arg_name};\n"
			fc.exprs.add "	{arg_name} = argv[{k}].{mtype.call_arg_field};\n"
			args_for_call.add arg_name

			k += 1
		end
		for param in msignature.mparameters do
			var mtype = param.mtype
			var arg_name = "arg__"+param.name

			fc.decls.add "	{mtype.cname_blind} {arg_name};\n"
			fc.exprs.add "	{arg_name} = argv[{k}].{mtype.call_arg_field};\n"
			args_for_call.add arg_name

			k += 1
		end

		# Call implementation function
		var args_compressed = args_for_call.join(", ")
		var method_call = "{impl_cname}({args_compressed})"
		if return_mtype != null then
			fc.decls.add """
	{{{return_mtype.cname_blind}}} return_value;
"""
			fc.exprs.add """
	return_value = {{{method_call}}};
	result->{{{return_mtype.call_arg_field}}} = return_value;
"""
		else
			fc.exprs.add "	{method_call};\n"
		end

		fc.exprs.add "	return 0;\n"

		ecc.add_exported_function fc
	end
end
src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit:283,1--375,3

nitc :: astbuilder $ MMethodDef
redef class MMethodDef
	redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AMethPropdef do
		if astbuilder == null then astbuilder = new ASTBuilder(mclassdef.mmodule)
		var tk_redef = null
		if self.mproperty.intro != self then tk_redef = new TKwredef
		var  n_signature = if self.msignature == null then new ASignature else self.msignature.create_ast_representation(astbuilder)
		return astbuilder.make_method(visibility.create_ast_representation(astbuilder), tk_redef, self, n_signature)
	end
end
src/astbuilder.nit:983,1--991,3

nitc :: abstract_compiler $ MMethodDef
redef class MMethodDef
	# Can the body be inlined?
	fun can_inline(v: VISITOR): Bool
	do
		if is_abstract then return true
		if constant_value != null then return true
		var modelbuilder = v.compiler.modelbuilder
		var node = modelbuilder.mpropdef2node(self)
		if node isa APropdef then
			return node.can_inline
		else if node isa AClassdef then
			# Automatic free init is always inlined since it is empty or contains only attribtes assigments
			return true
		else if node == null then
			return true
		else
			abort
		end
	end

	# Inline the body in another visitor
	fun compile_inside_to_c(v: VISITOR, arguments: Array[RuntimeVariable]): nullable RuntimeVariable
	do
		var modelbuilder = v.compiler.modelbuilder
		var val = constant_value
		var node = modelbuilder.mpropdef2node(self)

		if is_abstract then
			v.add_raw_throw
			var cn = v.class_name_string(arguments.first)
			v.current_node = node
			v.add("PRINT_ERROR(\"Runtime error: Abstract method `%s` called on `%s`\", \"{mproperty.name.escape_to_c}\", {cn});")
			v.add_raw_abort
			return null
		end

		if node isa APropdef then
			var oldnode = v.current_node
			v.current_node = node
			self.compile_parameter_check(v, arguments)
			node.compile_to_c(v, self, arguments)
			v.current_node = oldnode
		else if node isa AClassdef then
			var oldnode = v.current_node
			v.current_node = node
			self.compile_parameter_check(v, arguments)
			node.compile_to_c(v, self, arguments)
			v.current_node = oldnode
		else if val != null then
			v.ret(v.value_instance(val))
		else
			abort
		end
		return null
	end

	# Generate type checks in the C code to check covariant parameters
	fun compile_parameter_check(v: VISITOR, arguments: Array[RuntimeVariable])
	do
		if v.compiler.modelbuilder.toolcontext.opt_no_check_covariance.value then return

		var msignature = self.msignature.as(not null)

		for i in [0..msignature.arity[ do
			var mp = msignature.mparameters[i]
			# skip test for vararg since the array is instantiated with the correct polymorphic type
			if mp.is_vararg then continue

			# skip if the cast is not required
			var origmtype =  self.mproperty.intro.msignature.mparameters[i].mtype
			if not origmtype.need_anchor then continue

			# get the parameter type
			var mtype = mp.mtype

			# generate the cast
			# note that v decides if and how to implements the cast
			v.add("/* Covariant cast for argument {i} ({mp.name}) {arguments[i+1].inspect} isa {mtype} */")
			v.add_cast(arguments[i+1], mtype, "covariance")
		end
	end
end
src/compiler/abstract_compiler.nit:2528,1--2609,3

nitc :: vim_autocomplete $ MMethodDef
redef class MMethodDef
	redef fun write_signature_to_stream(stream)
	do
		var msignature = msignature
		if msignature != null then
			stream.write msignature.to_s
		end
	end

	redef fun write_location(mainmodule, stream)
	do
		for i in 2.times do stream.write line_separator
		stream.write "## Location of introduction and refinements"

		# Group locations in the same file
		var file_to_location = new MultiHashMap[nullable SourceFile, Location]
		for c in mproperty.mpropdefs do
			file_to_location[c.location.file].add c.location
		end

		# Write one file per location
		for file, locations in file_to_location do
			var l = locations.first
			stream.write line_separator
			stream.write "* {l}"
			if locations.length > 1 then stream.write " ({locations.length-1} more)"
		end
	end
end
src/doc/vim_autocomplete.nit:111,1--139,3

nitc :: contracts $ MMethodDef
redef class MMethodDef

	# Verification of the contract facet
	# Check if a contract facet already exists to use it again or if it is necessary to create it.
	private fun check_contract_facet(v: ContractsVisitor, n_signature: ASignature, classdef: MClassDef, mcontract: MContract, exist_contract: Bool)
	do
		var exist_contract_facet = mproperty.check_exist_contract_facet(self)
		if exist_contract_facet and exist_contract then return

		var contract_facet: AMethPropdef
		if not exist_contract_facet then
			# If has no contract facet in intro just create it
			if classdef != mproperty.intro_mclassdef then create_contract_facet(v, mproperty.intro_mclassdef, n_signature)
			# If has no contract facet just create it
			contract_facet = create_contract_facet(v, classdef, n_signature)
		else
			# Check if the contract facet already exist in this context (in this classdef)
			if classdef.mpropdefs_by_property.has_key(mproperty.mcontract_facet) then
				# get the define
				contract_facet = v.toolcontext.modelbuilder.mpropdef2node(classdef.mpropdefs_by_property[mproperty.mcontract_facet]).as(AMethPropdef)
			else
				# create a new contract facet definition
				contract_facet = create_contract_facet(v, classdef, n_signature)
				var block = v.ast_builder.make_block
				# super call to the contract facet
				var n_super_call = v.ast_builder.make_super_call(n_signature.make_parameter_read(v.ast_builder), null)
				# verification for add a return or not
				if contract_facet.mpropdef.msignature.return_mtype != null then
					block.add(v.ast_builder.make_return(n_super_call))
				else
					block.add(n_super_call)
				end
				contract_facet.n_block = block
			end
		end
		contract_facet.adapt_block_to_contract(v, mcontract, contract_facet)
		contract_facet.location = v.current_location
		contract_facet.do_all(v.toolcontext)
	end

	# Method to create a contract facet of the method
	private fun create_contract_facet(v: ContractsVisitor, classdef: MClassDef, n_signature: ASignature): AMethPropdef
	do
		var contract_facet = mproperty.mcontract_facet
		assert contract_facet != null
		# Defines the contract phase is an init or not
		# it is necessary to use the contracts on constructor
		contract_facet.is_init = self.mproperty.is_init

		# check if the method has an `msignature` to copy it.
		var m_signature: nullable MSignature = null
		if mproperty.intro.msignature != null then m_signature = mproperty.intro.msignature.clone

		var n_contractdef = classdef.mclass.create_empty_method(v, contract_facet, classdef, m_signature, n_signature)
		# FIXME set the location because the callsite creation need the node location
		n_contractdef.location = v.current_location
		n_contractdef.validate

		var block = v.ast_builder.make_block
		var n_self = new ASelfExpr
		var args = n_contractdef.n_signature.make_parameter_read(v.ast_builder)
		var callsite = v.ast_builder.create_callsite(v.toolcontext.modelbuilder, n_contractdef, mproperty, true)
		var n_call = v.ast_builder.make_call(n_self, callsite, args)

		if m_signature.return_mtype == null then
			block.add(n_call)
		else
			block.add(v.ast_builder.make_return(n_call))
		end

		n_contractdef.n_block = block
		n_contractdef.do_all(v.toolcontext)
		return n_contractdef
	end

	# Entry point to build contract (define the contract facet and define the contract method verification)
	private fun construct_contract(v: ContractsVisitor, n_signature: ASignature, n_annotation: AAnnotation, mcontract: MContract, exist_contract: Bool)
	do
		if check_same_contract(v, n_annotation, mcontract) then return
		if not exist_contract and not is_intro then no_intro_contract(v, n_signature, mcontract, n_annotation)
		v.define_signature(mcontract, n_signature, mproperty.intro.msignature)

		var conditiondef = v.build_contract(n_annotation, mcontract, mclassdef)
		check_contract_facet(v, n_signature.clone, mclassdef, mcontract, exist_contract)
		has_contract = true
	end

	# Create a contract on the introduction classdef of the property.
	# Display an warning message if necessary
	private fun no_intro_contract(v: ContractsVisitor, n_signature: ASignature, mcontract: MContract, n_annotation: AAnnotation)
	do
		mcontract.create_empty_contract(v, mcontract.intro_mclassdef, mcontract.adapt_msignature(self.mproperty.intro.msignature), mcontract.adapt_nsignature(n_signature))
		mcontract.no_intro_contract(v, n_annotation)
		mproperty.intro.has_contract = true
	end

	# Is the contract already defined in the context
	#
	# Exemple :
	# fun foo is expect([...]), expect([...])
	#
	# Here `check_same_contract` display an error when the second expect is processed
	private fun check_same_contract(v: ContractsVisitor, n_annotation: AAnnotation ,mcontract: MContract): Bool
	do
		if self.mclassdef.mpropdefs_by_property.has_key(mcontract) then
			v.toolcontext.error(n_annotation.location, "The method already has a defined `{mcontract.contract_name}` contract at line {self.mclassdef.mpropdefs_by_property[mcontract].location.line_start}")
			return true
		end
		return false
	end
end
src/contracts.nit:653,1--763,3

nitc :: separate_compiler $ MMethodDef
redef class MMethodDef
	# The C function associated to a mmethoddef
	fun separate_runtime_function: SeparateRuntimeFunction
	do
		var res = self.separate_runtime_function_cache
		if res == null then
			var recv = mclassdef.bound_mtype
			var msignature = msignature.resolve_for(recv, recv, mclassdef.mmodule, true)
			res = new SeparateRuntimeFunction(self, recv, msignature, c_name)
			self.separate_runtime_function_cache = res
		end
		return res
	end

	# Returns true if the current method definition differ from
	# its original introduction in terms of receiver type.
	fun recv_differ_from_intro: Bool
	do
		var intromclassdef = mproperty.intro.mclassdef
		var introrecv = intromclassdef.bound_mtype
		return self.mclassdef.bound_mtype != introrecv
	end

	# The C thunk function associated to a mmethoddef. Receives only nullable
	# Object and cast them to the original mmethoddef signature.
	fun callref_thunk(recv_mtype: MClassType): SeparateThunkFunction
	do
		var res = callref_thunk_cache
		if res == null then
			var object_type = mclassdef.mmodule.object_type
			var nullable_object = object_type.as_nullable
			var ps = new Array[MParameter]

			# Replace every argument type by nullable object
			for p in msignature.mparameters do
				ps.push(new MParameter(p.name, nullable_object, p.is_vararg))
			end
			var ret: nullable MType = null
			if msignature.return_mtype != null then ret = nullable_object
			var msignature2 = new MSignature(ps, ret)
			var intromclassdef = mproperty.intro.mclassdef

			res = new SeparateThunkFunction(self, recv_mtype, msignature2, "THUNK_{c_name}", mclassdef.bound_mtype)
			res.polymorph_call_flag = true
			callref_thunk_cache = res
		end
		return res
	end

	private var callref_thunk_cache: nullable SeparateThunkFunction
	private var separate_runtime_function_cache: nullable SeparateRuntimeFunction

	# The C function associated to a mmethoddef, that can be stored into a VFT of a class
	# The first parameter (the reciever) is always typed by val* in order to accept an object value
	# The C-signature is always compatible with the intro
	fun virtual_runtime_function: SeparateRuntimeFunction
	do
		var res = self.virtual_runtime_function_cache
		if res == null then
			# Because the function is virtual, the signature must match the one of the original class
			var intromclassdef = mproperty.intro.mclassdef
			var recv = intromclassdef.bound_mtype

			res = separate_runtime_function
			if res.called_recv == recv then
				self.virtual_runtime_function_cache = res
				return res
			end

			var msignature = mproperty.intro.msignature.resolve_for(recv, recv, intromclassdef.mmodule, true)

			if recv.ctype == res.called_recv.ctype and msignature.c_equiv(res.called_signature) then
				self.virtual_runtime_function_cache = res
				return res
			end
			res = new SeparateThunkFunction(self, recv, msignature, "VIRTUAL_{c_name}", mclassdef.bound_mtype)
		end
		return res
	end
	private var virtual_runtime_function_cache: nullable SeparateRuntimeFunction
end
src/compiler/separate_compiler.nit:2364,1--2444,3

nitc :: term_model $ MMethodDef
redef class MMethodDef
	redef fun cs_signature(no_color) do
		return msignature.as(not null).cs_signature(no_color)
	end
end
src/doc/templates/term_model.nit:200,1--204,3

nitc :: uml_module $ MMethodDef
redef class MMethodDef
	redef fun tpl_module(model) do
		var t = new Template
		t.add mproperty.visibility.tpl_class
		t.add " "
		t.add name.escape_to_dot
		t.add msignature.tpl_class(model)
		return t
	end
end
src/uml/uml_module.nit:132,1--141,3

nitc :: java_compiler $ MMethodDef
redef class MMethodDef
	super TableCallable

	# Runtime name
	private fun rt_name: String do
		return "RTMethod_{mclassdef.mmodule.jname}_{mclassdef.mclass.jname}_{mproperty.jname}"
	end

	# Generate a Java RTMethod for `self`
	fun compile_to_java(v: JavaCompilerVisitor) do
		v.add("public class {rt_name} extends RTMethod \{")
		v.add("  protected static RTMethod instance;")
		v.add("  public static RTMethod get{rt_name}() \{")
		v.add("    if(instance == null) \{")
		v.add("      instance = new {rt_name}();")
		v.add("    \}")
		v.add("    return instance;")
		v.add("  \}")
		v.add("  @Override")
		v.add("  public RTVal exec(RTVal[] args) \{")
		compile_inside_to_java(v)
		v.add("  \}")
		v.add("\}")
	end

	# Compile the body of this function
	fun compile_inside_to_java(v: JavaCompilerVisitor) do

		var modelbuilder = v.compiler.modelbuilder
		var node = modelbuilder.mpropdef2node(self)

		var recv = mclassdef.bound_mtype
		var arguments = new Array[RuntimeVariable]
		var frame = new JavaStaticFrame(v, self, recv, arguments)
		v.frame = frame

		var selfvar = v.decl_var("self", recv)
		arguments.add(selfvar)
		var boxed = v.new_expr("args[0]", v.compiler.mainmodule.object_type)
		v.add "{selfvar} = {v.autobox(boxed, recv)};"

		var msignature = self.msignature
		var ret = null
		if msignature != null then
			ret = msignature.return_mtype
			if ret != null then
				var retvar = v.decl_var("ret", ret)
				if ret.name == "Int" then v.add "{retvar} = 0;"
				if ret.name == "Float" then v.add "{retvar} = 0.0;"
				if ret.name == "Bool" then v.add "{retvar} = false;"
				if ret.name == "Char" then v.add "{retvar} = 0;"
				if ret.name == "Byte" then v.add "{retvar} = 0;"
				frame.returnvar = retvar
			end
		end
		frame.returnlabel = v.get_name("RET_LABEL")

		v.current_node = node
		if is_abstract then
			v.add_abort("Abstract method `{mproperty.name}` called on `\"  + {selfvar}.rtclass.class_name +\"`")
			v.add("return null;")
			return
		end
		v.current_node = null

		v.add("{frame.returnlabel.as(not null)}: \{")

		if node isa APropdef then
			node.compile_to_java(v, self, arguments)
		else if node isa AClassdef then
			node.compile_to_java(v, self, arguments)
		else
			abort
		end

		v.add("\}")
		if ret != null then
			v.add("return {v.autobox(frame.returnvar.as(not null), v.compiler.mainmodule.object_type)};")
		else
			v.add("return null;")
		end
	end
end
src/compiler/java_compiler.nit:1399,1--1481,3

nitc :: method_analyze_metrics $ MMethodDef
redef class MMethodDef
	var line_number = 0
	var total_self_call = 0
	var class_call = new Counter[MClassType]
end
src/metrics/method_analyze_metrics.nit:75,1--79,3

nitc :: html_model $ MMethodDef
redef class MMethodDef
	redef fun html_signature(short) do
		var msignature = self.msignature
		if msignature == null then return new Template
		return msignature.html_signature(short)
	end
end
src/doc/templates/html_model.nit:252,1--258,3

nitc :: json_model $ MMethodDef
redef class MMethodDef
	redef fun core_serialize_to(v) do
		super
		v.serialize_attribute("msignature", msignature)
	end
end
src/doc/templates/json_model.nit:283,1--288,3