variables:
NEO4J_AUTH: none
+ POSTGRES_HOST_AUTH_METHOD: trust
cache:
paths:
If you do not want to submit code for some reason, you are always welcome to ask questions about the language or related topics via the issue system.
You may also proof-read and correct documentation if you are willing!
-All the documents on this repository are written in English, however most of our contributors are not native anglophones.
+All the documents in this repository are written in English. However, most of our contributors are not native anglophones.
Therefore we encourage people, especially those coming of an english-speaking culture to read the documentation available and submit patches to correct bad formulations, typos or related mistakes on our part through the usual system.
* lib/ Nit standard library
* LICENCE License of the software
* Makefile Bootstrap the Nit tools
- * misc/ Some additional files for commons text editors and tools
+ * misc/ Some additional files for common text editors and tools
* NOTICE.md List of the authors
* README This file
* share/ Common resources used by tools
init init_error(message: String, loc: Location)
do
- init(loc)
+ self.location = loc
self.message = message
end
end
Literal strings are enclosed within quotes (`"`).
To insert a value
inside a literal string, include the values inside braces (`{}`).
-Braces has to be escaped.
-`+` is the concatenation operator but is less efficient than the brace form.
+Braces have to be escaped.
+`+` is the concatenation operator, but is less efficient than the brace form.
~~~
var j = 5
~~~
Multi-line strings are enclosed with triple quotes (`"""`).
-Values are inserted with a triple braces (`{{{value}}}`).
+Values are inserted with triple braces (`{{{value}}}`).
The multi-line form thus allows verbatim new-lines, quotes and braces
~~~
All objects have a `to_s` method that converts the object to a String.
`print` is a top-level method that takes any number of arguments and
-prints to the standard output. `print` always add a newline, another
-top-level method, `printn`, does not add the newline.
+prints them to the standard output. `print` always adds a newline to the output, another
+top-level method, `printn`, does not add a newline.
~~~
var x: String
`<`, `>`, `<=`, `>=` and `<=>` on `Comparable` objects (which include
`Int`, `String` and others).
-- `==`, `<`, `>`, `<=`, `>=` and `<=>` are standard Nit operators (so they are redefinable).
+- `==`, `<`, `>`, `<=`, `>=` and `<=>` are standard Nit operators thus are redefinable.
- `and`, `or` and `not` are not standard Nit operators: they are not
redefinable, also they are lazy and have adaptive typing flow
- `==` is not for reference equality but for value equality (like
`equals` in Java). There is a special reference equality operator,
`is`, but it cannot be redefined and its usage is not recommended.
- Note also that while `==` is redefinable, it has a special adaptive
+ Note that while `==` is redefinable, it has a special adaptive
typing flow effect when used with `null`.
- `!=` is not a standard Nit operator. In fact `x != y` is
- enums (e.g. `Int` or `Bool`) can only specialize interfaces, cannot have attributes, cannot have constructors, have proper instances but they are not instantiated by the programmer—it means no `new Int`. Note that at this point there is no user-defined enums.
-All kinds of classes must have a name, can have some superclasses and can have some definitions of properties. Properties are methods, attributes, constructors and virtual types. All kinds of classes can also be generic. When we talk about “classes” in general, it means all these four kinds. We say “concrete classes” to designate only the classes declared with the `class` keyword alone.
+All kinds of classes must have a name, can have some superclasses and can have some definitions of properties. Properties are methods, attributes, constructors and virtual types. All kinds of classes can also be generic. When documentation refers to “classes” , it generally refers to all four kinds. The term “concrete classes” is used to designate the classes declared with the `class` keyword alone.
## Class Specialization
- adding new superclasses.
-Note that the kind or the visibility of a class cannot be changed by a refinement. Therefore, it is allowed to just write `redef class X` whatever is the kind or the visibility of `X`.
+Note that the kind or the visibility of a class cannot be changed by a refinement. Therefore, it is allowed to just write `redef class X` regardless of the kind or the visibility of `X`.
In programs, the real instantiated classes are always the combination of all their refinements.
Classes in OO models are often a simple aggregates of attributes and methods.
-By default, the `new` construction require a value for each attribute defined in a class without a default value.
+By default, the `new` construction requires a value for each attribute defined in a class without a default value.
~~~
class Product
## Uncollected attributes
-There is three cases for an attributes to not be collected in the `new`.
+There are three cases for which an attribute is not collected in a `new` construction.
* Attributes with a default value
* Attributes with the annotation `noinit`
## Generalized initializers
-Initializers are methods that are automatically invoked by the new.
-In fact, by default, the setter of an attribute is used as a initializer.
+Initializers are methods that are automatically invoked by `new`.
+In fact, by default, the setter of an attribute is used as an initializer.
`autoinit` is used to register a method as a setter.
assert fp.z == 13
~~~
-Generalized setters are a powerful tool but often needed in only rare specific cases.
-In most case, there is no reason that an argument of a `new` construction is not stored in the object as a real attribute.
+Generalized setters are a powerful tool, but only needed in rare specific cases.
+In most cases, there is no reason for an argument of a `new` construction to not be stored in the object as a real attribute.
## Inheritance
## `new` factories
-`new` factories permit to completely shortcut the class instantiation mechanim.
+`new` factories allow to completely shortcut the class instantiation mechanism.
It could be used to provide `new` syntax on non-concrete class (mainly `extern class`).
`new` factories behave like a top-level function that return the result of the construction.
`super` calls the “previous” definition of the method. It is used in a redefinition of a method in a subclass or in a refinement, It can be used with or without arguments; in the latter case, the original arguments are implicitly used.
-The `super` of Nit behave more like the `call-next-method` of CLOS that the `super` of Java or Smalltalk. It permits the traversal of complex class hierarchies and refinement. Basically, `super` is polymorphic: the method called by `super` is not only determined by the class of
-definition of the method but also by the dynamic type of `self`.
+The `super` of Nit behaves more like the `call-next-method` of CLOS than the `super` of Java or Smalltalk. It permits the traversal of complex class hierarchies and refinement. Basically, `super` is polymorphic: the method called by `super` is not only determined by the class of
+definition of the method, but also by the dynamic type of `self`.
-The principle it to produce a strict order of the redefinitions of a method (the linearization). Each call to `super` call the next method definition in the linearization. From a technical point of view, the linearization algorithm used is based on C3. It ensures that:
+The principle is to produce a strict order of the redefinitions of a method (the linearization). Each call to `super` call the next method definition in the linearization. From a technical point of view, the linearization algorithm used is based on C3. It ensures that:
- A definition comes after its redefinition.
- bracket operator: `[]`. Its definition requires one parameter or more and a return value. Its invocation is done with `x[y, z]` where `x` is the receiver, `y` the first argument and `z` the second argument.
-- setters: `something=` where `something` can be any valid method identifier. Their definitions require one parameter or more and no return value. If there is only one parameter, the invocation is done with `x.something = y` where `x` is the receiver and y the argument. If there is more that one parameter, the invocation is done with `x.something(y, z) = t` where `x` is the receiver, `y` the first argument, `z` the second argument and `t` the last argument.
+- setters: `something=` where `something` can be any valid method identifier. Their definitions require one parameter or more and no return value. If there is only one parameter, the invocation is done with `x.something = y` where `x` is the receiver and `y` the argument. If there is more that one parameter, the invocation is done with `x.something(y, z) = t` where `x` is the receiver, `y` the first argument, `z` the second argument and `t` the last argument.
- bracket setter: `[]=`. Its definition requires two parameters or more and no return value. Its invocation is done with `x[y, z] = t` where `x` is the receiver, `y` the first argument, `z` the second argument and `t` the last argument.
# Modules
-`module` declares the name of a module. While optional it is recommended to use it, at least for documentation purpose. The basename of the source file must match the name declared with `module`. The extension of the source file must be `nit`.
+`module` declares the name of a module. While optional, it is recommended to use it, at least for documentation purposes. The basename of the source file must match the name declared with `module`. The extension of the source file must be `nit`.
A module is made of, in order:
- `private import` indicates a private importation. Importers of a given module will not automatically import its privately imported modules. An analogy is using `#include` in a body file (`.c`) in C/C++.
-- `intrude import` indicates an intrusive importation. `intrude` `import` bypasses the `private` visibility and gives to the importer module a full access on the imported module. Such an import may only be considered when modules are strongly bounded and developed together. The closest, but insufficient, analogy is something like including a body file in a body file in C/C++.
+- `intrude import` indicates an intrusive importation. `intrude` `import` bypasses the `private` visibility and gives to the importer module full access on the imported module. Such an import may only be considered when modules are strongly bounded and developed together. The closest, but insufficient, analogy is something like including a body file in a body file in C/C++.
## Visibility
\noindent\textbf{A Concise Reference of the Nit Language}
-This document attempts to be as short as possible while covering all features of the language in deepth.
+This document attempts to be as short as possible while covering all features of the language in depth.
It is not a real manual to learn the language since concepts are covered when required.
%Forward and backward references about concepts are written like this~\goto{redef} which means Section~\ref*{redef}.
%An index\goto{index} also lists concepts and keywords for an improved navigation.
- Adaptive typing.
-Some structures alter the control flow but are not described in this
+Some structures alter the control flow, but are not described in this
section: `and`, `or`, `not`, `or else` and `return`.
Note that the control flow is determined only from the position, the
end
~~~
-Note that `loop` is different from `while true` because the control flow does not consider the values of expression.
+Note that `loop` is different from `while true` because the control flow does not consider the values of expressions.
## do
-Single `do` are used to create scope for variables or to be attached with labeled breaks.
+Single `do` are used to create scoped variables or to be attached with labeled breaks.
~~~
do
# Local Variables and Static Typing
-`var` declares local variables. In fact there is no global variable in Nit, so in this document *variable* always refers to a local variable. A variable is visible up to the end of the current
+`var` declares local variables. In fact, there is no global variable in Nit, so in this document *variable* always refers to a local variable. A variable is visible up to the end of the current
control structure. Two variables with the same name cannot coexist: no nesting nor masking.
Variables are bound to values. A variable cannot be used unless it has a value in all control flow paths (à la Java).
## Variable Upper Bound
-An optional type information can be added to a variable declaration. This type is used as an upper bound of the type of the variable. When a initial value is given in a variable declaration without a specific type information, the static type of the initial value is used as an upper bound. If no type and no initial value are given, the upper bound is set to `nullable Object`.
+An optional type information can be added to a variable declaration. This type is used as an upper bound of the type of the variable. When an initial value is given in a variable declaration without a specific type information, the static type of the initial value is used as an upper bound. If no type and no initial value are given, the upper bound is set to `nullable Object`.
~~~nitish
var e: Int # Upper bound is Int
print max # outputs 11
~~~
-Note that type adaptation occurs only in an `isa` if the target type is more specific that the current type.
+Note that type adaptation occurs only in an `isa` if the target type is more specific than the current type.
~~~
var col: Collection[Int] = [1, 2, 3]
var game: G
# Create a new game turn for `game`.
- init (game: G) is old_style_init do
- super(game.tick)
- self.game = game
+ init(game: G)
+ is
+ is_old_style_init
+ do
+ _tick = game.tick
+ _game = game
end
# Insert the Bucketable event `e` to be executed at next tick.
# var a = [5, 2, 3, 1, 4]
# default_comparator.quick_sort(a, 0, a.length - 1)
# assert a == [1, 2, 3, 4, 5]
+ # var a2 = new Array[Int]
+ # default_comparator.quick_sort(a2, 0, a2.length - 1)
+ # assert a2 == new Array[Int]
+ # var a3 = [1]
+ # default_comparator.quick_sort(a3, 0, a3.length - 1)
+ # assert a3 == [1]
fun quick_sort(array: Array[COMPARED], from: Int, to: Int) do
+ if from >= to then return
var pivot = array[from]
var i = from
var j = to
intrude import parser
intrude import semantize::scope
intrude import modelbuilder_base
+intrude import modelize_property
# General factory to build semantic nodes in the AST of expressions
class ASTBuilder
return new ANotExpr.make(expr)
end
+ # Make a new attribute
+ fun make_attribute(name: String,
+ n_type: nullable AType,
+ n_visibility: nullable AVisibility,
+ initial_value: nullable AExpr,
+ n_block: nullable AExpr,
+ m_attributedef: nullable MAttributeDef,
+ m_setterdef: nullable MMethodDef,
+ m_getterdef: nullable MMethodDef): AAttrPropdef
+ do
+ return new AAttrPropdef.make(name, n_type, n_visibility, initial_value, n_block, m_attributedef, m_setterdef, m_getterdef)
+ end
+
+ # Make a new class (AStdClassdef)
+ fun make_class(mclassdef: nullable MClassDef,
+ n_visibility: nullable AVisibility,
+ n_formaldefs : Collection[AFormaldef],
+ n_extern_code_block : nullable AExternCodeBlock,
+ n_propdefs : Collection[APropdef],
+ n_classkind: nullable AClasskind): AStdClassdef
+ do
+ return new AStdClassdef.make(mclassdef, n_visibility, n_formaldefs, n_extern_code_block, n_propdefs, n_classkind)
+ end
+
+ fun make_var(variable: Variable, mtype: MType): AVarExpr
+ do
+ return new AVarExpr.make(variable, mtype)
+ end
+
+ # Make a call assignment i.e `a = 10`
+ fun make_call_assign(recv: AExpr, callsite: CallSite, n_args: nullable Collection[AExpr], n_value: AExpr): ACallAssignExpr
+ do
+ return new ACallAssignExpr.make(recv, callsite, n_args, n_value)
+ end
+
# Build a callsite to call the `mproperty` in the current method `caller_method`.
# `is_self_call` indicate if the method caller is a property of `self`
- fun create_callsite(modelbuilder: ModelBuilder, caller_method : AMethPropdef, mproperty: MMethod, is_self_call: Bool): CallSite
+ fun create_callsite(modelbuilder: ModelBuilder, caller_property: APropdef, mproperty: MMethod, is_self_call: Bool): CallSite
do
# FIXME It's not the better solution to call `TypeVisitor` here to build a model entity, but some make need to have a callsite
- var type_visitor = new TypeVisitor(modelbuilder, caller_method.mpropdef.as(not null))
- var callsite = type_visitor.build_callsite_by_property(caller_method, mproperty.intro_mclassdef.bound_mtype, mproperty, is_self_call)
+ var type_visitor = new TypeVisitor(modelbuilder, caller_property.mpropdef.as(not null))
+ var callsite = type_visitor.build_callsite_by_property(caller_property, mproperty.intro_mclassdef.bound_mtype, mproperty, is_self_call)
assert callsite != null
return callsite
end
end
end
+redef class ACallAssignExpr
+ private init make(recv: AExpr, callsite: CallSite, args: nullable Collection[AExpr], n_value: AExpr)
+ do
+ _callsite = callsite
+ _mtype = callsite.recv
+ _is_typed = true
+ var n_args = new AListExprs
+ if args != null then
+ n_args.n_exprs.add_all(args)
+ end
+ var n_qid = new AQid
+ n_qid.n_id = new TId
+ n_qid.n_id.text = callsite.mproperty.name
+ init_acallassignexpr(recv, n_qid, n_args, new TAssign, n_value)
+ end
+end
+
+redef class AStdClassdef
+ private init make(mclassdef: nullable MClassDef,
+ n_visibility: nullable AVisibility,
+ n_formaldefs : Collection[Object],
+ n_extern_code_block : nullable AExternCodeBlock,
+ n_propdefs : Collection[Object],
+ n_classkind: nullable AClasskind)
+ do
+ if n_visibility == null then n_visibility = new APublicVisibility
+ if n_classkind == null then n_classkind = new AConcreteClasskind.init_aconcreteclasskind(new TKwclass)
+ var n_qid = new AQclassid.init_aqclassid(null, new TClassid)
+ init_astdclassdef(null, null, n_visibility, n_classkind, n_qid, null, n_formaldefs, null, n_extern_code_block, n_propdefs, new TKwend)
+ _mclassdef = mclassdef
+ _mclass = mclassdef.mclass
+ end
+end
+
+redef class AAttrPropdef
+
+ # Create a new `AAttrPropdef`
+ # Note: By default if the `AVisibility` is not given the visibility is set to public
+ private init make(name: String,
+ n_type: nullable AType,
+ n_visibility: nullable AVisibility,
+ initial_value: nullable AExpr,
+ n_block: nullable AExpr,
+ m_attributedef: nullable MAttributeDef,
+ m_setterdef: nullable MMethodDef,
+ m_getterdef: nullable MMethodDef)
+ do
+ # Set the model type
+ if n_type != null then mtype = n_type.mtype
+ # Define the visibility default is public
+ if n_visibility == null then n_visibility = new APublicVisibility
+ init_aattrpropdef(null, null, n_visibility, new TKwvar, new TId, n_type, null, initial_value, null, null , n_block, null)
+ # Set the name of the attribute
+ _n_id2.text = name
+ _mpropdef = m_attributedef
+ _mreadpropdef = m_getterdef
+ _mwritepropdef = m_setterdef
+ if initial_value != null or n_block != null then has_value = true
+ if m_attributedef != null then self.location = m_attributedef.location
+ end
+end
+
redef class ANotExpr
private init make(expr: AExpr)
do
if n_visibility == null then n_visibility = new APublicVisibility
self.init_amethpropdef(null,tk_redef,n_visibility,new TKwmeth,null,null,null,n_methid,n_signature,n_annotations,n_extern_calls,n_extern_code_block,new TKwdo,n_block,new TKwend)
self.mpropdef = mmethoddef
+ if mpropdef != null then self.location = mmethoddef.location
+ end
+
+ # Execute all method verification scope flow and typing.
+ # It also execute an ast validation to define all parents and all locations
+ fun do_all(toolcontext: ToolContext)
+ do
+ self.validate
+ # FIXME: The `do_` usage it is maybe to much (verification...). Solution: Cut the `do_` methods into simpler parts
+ self.do_scope(toolcontext)
+ self.do_flow(toolcontext)
+ self.do_typing(toolcontext.modelbuilder)
end
end
end
end
-redef class AAsCastExpr
- private init make(n_expr: AExpr, n_type: AType)
- do
- init_aascastexpr(n_expr, new TKwas , null , n_type, null)
- end
-end
-
redef class AAsNotnullExpr
private init make(n_expr: AExpr, t: nullable MType)
do
end
redef class ASignature
+
+ init make_from_msignature(msignature: MSignature)
+ do
+ var nparams = new Array[AParam]
+ for mparam in msignature.mparameters do
+ var variable = new Variable(mparam.name)
+ variable.declared_type = mparam.mtype
+ n_params.add(new AParam.make(variable, new AType.make(mparam.mtype)))
+ end
+ var return_type = null
+ if msignature.return_mtype != null then return_type = new AType.make(msignature.return_mtype)
+ init_asignature(null, nparams, null, return_type)
+ end
+
redef fun clone: SELF
do
var ntype = n_type
private init make(v: nullable Variable, t: nullable AType)
do
_n_id = new TId
+ if v != null then _n_id.text = v.name
_variable = v
_n_type = t
end
end
end
+redef class AFormaldef
+
+ private init make(mparameter: MParameterType, t: AType)
+ do
+ _n_id = new TClassid
+ _n_id.text = mparameter.name
+ _n_type = t
+ _mtype = mparameter
+ end
+end
+
redef class ABlockExpr
private init make(t: nullable MType)
do
_n_args = n_args
end
end
+
+redef class MEntity
+ # Build a ANode from `self`
+ #
+ # Allows the creation of an AST node from a model entity.
+ fun create_ast_representation(astbuilder: nullable ASTBuilder): ANode is abstract
+end
+
+redef class MPropDef
+ redef fun create_ast_representation(astbuilder: nullable ASTBuilder): APropdef is abstract
+end
+
+redef class MClassDef
+ redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AStdClassdef do
+ if astbuilder == null then astbuilder = new ASTBuilder(mmodule)
+ var n_propdefs = new Array[APropdef]
+ for mpropdef in self.mpropdefs do
+ n_propdefs.add(mpropdef.create_ast_representation(astbuilder))
+ end
+ var n_formaldefs = new Array[AFormaldef]
+ for mparameter in self.mclass.mparameters do n_formaldefs.add(mparameter.create_ast_representation(astbuilder))
+
+ return astbuilder.make_class(self, visibility.create_ast_representation(astbuilder), n_formaldefs, null, n_propdefs, null)
+ end
+end
+
+redef class MAttributeDef
+ redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AAttrPropdef do
+ if astbuilder == null then astbuilder = new ASTBuilder(mclassdef.mmodule)
+ var ntype = null
+ if self.static_mtype != null then ntype = static_mtype.create_ast_representation(astbuilder)
+ return astbuilder.make_attribute("_" + self.name, ntype, self.visibility.create_ast_representation(astbuilder), null, null, self, null, null)
+ end
+end
+
+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
+
+redef class MVisibility
+ fun create_ast_representation(astbuilder: nullable ASTBuilder): AVisibility do
+ if self.to_s == "public" then
+ return new APublicVisibility
+ else if self.to_s == "private" then
+ return new APrivateVisibility
+ else if self.to_s == "protected" then
+ return new AProtectedVisibility
+ else
+ return new AIntrudeVisibility
+ end
+ end
+end
+
+redef class MSignature
+ redef fun create_ast_representation(astbuilder: nullable ASTBuilder): ASignature do
+ var nparams = new Array[AParam]
+ for mparam in mparameters do nparams.add(mparam.create_ast_representation(astbuilder))
+ var return_type = null
+ if self.return_mtype != null then return_type = self.return_mtype.create_ast_representation(astbuilder)
+ return new ASignature.init_asignature(null, nparams, null, return_type)
+ end
+end
+
+redef class MParameter
+ redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AParam do
+ var variable = new Variable(self.name)
+ variable.declared_type = self.mtype
+ return new AParam.make(variable, self.mtype.create_ast_representation(astbuilder))
+ end
+end
+
+redef class MParameterType
+ redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AFormaldef do
+ var n_type = super
+ return new AFormaldef.make(self, n_type)
+ end
+end
+
+redef class MType
+ redef fun create_ast_representation(astbuilder: nullable ASTBuilder): AType do
+ return new AType.make(self)
+ end
+end
+
+redef class ModelBuilder
+ # Try to get MMethod property if exist in the given mclassdef. return new `MMethod` if not exist.
+ private fun get_mmethod(name: String, mclassdef: MClassDef, visibility: nullable MVisibility): MMethod do
+ visibility = visibility or else public_visibility
+ var mproperty = try_get_mproperty_by_name(null, mclassdef, name).as(nullable MMethod)
+ if mproperty == null then mproperty = new MMethod(mclassdef, name, mclassdef.location, visibility)
+ return mproperty
+ end
+
+ # Creation of a new method (AST and model representation) with the given name.
+ # See `create_method_from_property` for more information.
+ fun create_method_from_name(name: String, mclassdef: MClassDef, is_abstract: Bool, msignature: nullable MSignature, visibility: nullable MVisibility): AMethPropdef do
+ var mproperty = get_mmethod(name, mclassdef, visibility)
+ return create_method_from_property(mproperty, mclassdef, is_abstract, msignature)
+ end
+
+ # Creation of a new method (AST and model representation) with the given MMethod.
+ # Take care, if `is_abstract == false` the AMethPropdef returned has an empty body (potential error if the given signature has an return type).
+ fun create_method_from_property(mproperty: MMethod, mclassdef: MClassDef, is_abstract: Bool, msignature: nullable MSignature): AMethPropdef do
+ var m_def = new MMethodDef(mclassdef, mproperty, mclassdef.location)
+
+ if msignature == null then msignature = new MSignature(new Array[MParameter])
+
+ m_def.msignature = msignature
+ m_def.is_abstract = true
+ var n_def = m_def.create_ast_representation
+ # Association new npropdef to mpropdef
+ unsafe_add_mpropdef2npropdef(m_def,n_def)
+
+ if not is_abstract then
+ n_def.mpropdef.is_abstract = false
+ n_def.n_block = new ABlockExpr.make
+ end
+
+ return n_def
+ end
+
+ # Creation of a new attribute (AST and model representation) with the given name.
+ # See `create_attribute_from_property` for more information.
+ fun create_attribute_from_name(name: String, mclassdef: MClassDef, mtype: MType, visibility: nullable MVisibility): AAttrPropdef do
+ if visibility == null then visibility = public_visibility
+ var mattribute = try_get_mproperty_by_name(null, mclassdef, name)
+ if mattribute == null then mattribute = new MAttribute(mclassdef, name, mclassdef.location, visibility)
+ return create_attribute_from_property(mattribute.as(MAttribute), mclassdef, mtype)
+ end
+
+ # Creation of a new attribute (AST and model representation) with the given MAttribute.
+ # See `create_attribute_from_propdef` for more information.
+ fun create_attribute_from_property(mattribute: MAttribute, mclassdef: MClassDef, mtype: MType): AAttrPropdef do
+ var attribut_def = new MAttributeDef(mclassdef, mattribute, mclassdef.location)
+ attribut_def.static_mtype = mtype
+ return create_attribute_from_propdef(attribut_def)
+ end
+
+ # Creation of a new attribute (AST representation) with the given MAttributeDef.
+ fun create_attribute_from_propdef(mattribut_def: MAttributeDef): AAttrPropdef
+ is
+ expect(mclassdef2node(mattribut_def.mclassdef) != null)
+ do
+ var n_attribute = mattribut_def.create_ast_representation
+
+ var nclass = mclassdef2node(mattribut_def.mclassdef)
+
+ n_attribute.location = mattribut_def.location
+ n_attribute.validate
+
+ nclass.n_propdefs.unsafe_add_all([n_attribute])
+ nclass.validate
+
+ n_attribute.build_read_property(self, mattribut_def.mclassdef)
+ n_attribute.build_read_signature
+
+ mpropdef2npropdef[mattribut_def] = n_attribute
+ return n_attribute
+ end
+
+ # Creation of a new class (AST and model representation) with the given name.
+ # `visibility` : Define the visibility of the method. If it's `null` the default is `public_visibility`
+ # See `create_class_from_mclass` for more information.
+ fun create_class_from_name(name: String, super_type: Array[MClassType], mmodule: MModule, visibility: nullable MVisibility): AStdClassdef do
+ if visibility == null then visibility = public_visibility
+ var mclass = try_get_mclass_by_name(null, mmodule, name)
+ if mclass == null then mclass = new MClass(mmodule, name, mmodule.location, new Array[String], concrete_kind, visibility)
+ return create_class_from_mclass(mclass, super_type, mmodule)
+ end
+
+ # Creation of a new class (AST and model representation) with the given MClass.
+ # This method creates a new concrete class definition `MClassDef`, and adds it to the class hierarchy.
+ # See `create_class_from_mclassdef` for more information.
+ fun create_class_from_mclass(mclass: MClass, super_type: Array[MClassType], mmodule: MModule): AStdClassdef do
+ var mclassdef = new MClassDef(mmodule, mclass.mclass_type, mmodule.location)
+ mclassdef.set_supertypes(super_type)
+ mclassdef.add_in_hierarchy
+
+ return create_class_from_mclassdef(mclassdef, mmodule)
+ end
+
+ # Creation of a new class (AST representation) with the given MClassDef.
+ # Note all the properties of our MClassDef will also generate an AST representation.
+ # Make an error if the attribute already has a representation in the modelbuilder.
+ # This method also create the default constructor.
+ fun create_class_from_mclassdef(mclassdef: MClassDef, mmodule: MModule): AStdClassdef do
+ var n_classdef = mclassdef.create_ast_representation
+ n_classdef.location = mclassdef.location
+ n_classdef.validate
+
+ for n_propdef in n_classdef.n_propdefs do
+ var mpropdef = n_propdef.mpropdef
+ assert mpropdef != null
+
+ var p_npropdef = mpropdef2node(mpropdef)
+ if p_npropdef != null then error(null, "The property `{mpropdef.name}` already has a representation in the AST.")
+ unsafe_add_mpropdef2npropdef(mpropdef, n_propdef)
+ end
+
+ process_default_constructors(n_classdef)
+ unsafe_add_mclassdef2nclassdef(mclassdef, n_classdef)
+
+ return n_classdef
+ end
+end
import counter
import pkgconfig
private import explain_assert_api
+import contracts
# Add compiling options
redef class ToolContext
# The targeted specific platform
var target_platform: Platform is noinit
+ # All methods who already has a callref_thunk generated for
+ var compiled_callref_thunk = new HashSet[MMethodDef]
+
+ var all_routine_types_name: Set[String] do
+ var res = new HashSet[String]
+ for name in ["Fun", "Proc", "FunRef", "ProcRef"] do
+ # Currently there's 20 arity per func type
+ for i in [0..20[ do
+ res.add("{name}{i}")
+ end
+ end
+ return res
+ end
+
init
do
self.realmainmodule = mainmodule
fun compile_callsite(callsite: CallSite, arguments: Array[RuntimeVariable]): nullable RuntimeVariable
do
if callsite.is_broken then return null
- var initializers = callsite.mpropdef.initializers
- if not initializers.is_empty then
- var recv = arguments.first
-
- var i = 1
- for p in initializers do
- if p isa MMethod then
- var args = [recv]
- for x in p.intro.msignature.mparameters do
- args.add arguments[i]
- i += 1
- end
- self.send(p, args)
- else if p isa MAttribute then
- self.write_attribute(p, recv, arguments[i])
- i += 1
- else abort
- end
- assert i == arguments.length
-
- return self.send(callsite.mproperty, [recv])
- end
-
return self.send(callsite.mproperty, arguments)
end
# The method is unsafe and is just a direct wrapper for the specific implementation of native arrays
fun native_array_set(native_array: RuntimeVariable, index: Int, value: RuntimeVariable) is abstract
+ # Instantiate a new routine pointer
+ fun routine_ref_instance(routine_mclass_type: MClassType, recv: RuntimeVariable, callsite: CallSite): RuntimeVariable is abstract
+
+ # Call the underlying referenced function
+ fun routine_ref_call(mmethoddef: MMethodDef, args: Array[RuntimeVariable]) is abstract
+
# Allocate `size` bytes with the low_level `nit_alloc` C function
#
# This method can be redefined to inject statistic or tracing code.
# of runtime variables to use in the call.
fun varargize(mpropdef: MMethodDef, map: nullable SignatureMap, recv: RuntimeVariable, args: SequenceRead[AExpr]): Array[RuntimeVariable]
do
- var msignature = mpropdef.new_msignature or else mpropdef.msignature.as(not null)
+ var msignature = mpropdef.msignature.as(not null)
var res = new Array[RuntimeVariable]
res.add(recv)
# The associated Nit method
var mmethoddef: MMethodDef
- protected var return_mtype: nullable MType = null
+ protected var return_mtype: nullable MType = null
# The mangled c name of the runtime_function
# Subclasses should redefine `build_c_name` instead
return res
end
- fun c_ref: String do return "&{c_name}"
+ fun c_ref: String do return "&{c_name}"
# Non cached version of `c_name`
protected fun build_c_name: String is abstract
# May inline the body or generate a C function call
fun call(v: VISITOR, arguments: Array[RuntimeVariable]): nullable RuntimeVariable is abstract
- # Returns `true` if the associated `mmethoddef`'s return type isn't null,
- # otherwise `false`.
- fun has_return: Bool
- do
- return mmethoddef.msignature.return_mtype != null
- end
-
- # The current msignature to use when compiling : `signature_to_c` and `body_to_c`.
- # This method is useful since most concrete implementation doesn't use the
- # mmethoddef's signature. By providing a definition in the abstract class,
- # subclasses can use any msignature.
- fun msignature: MSignature
- do
- return mmethoddef.msignature.as(not null)
- end
-
- # The current receiver type to compile : `signature_to_c` and `body_to_c`.
- # See `msignature` method for more information.
- protected fun recv_mtype: MType
- do
- return mmethoddef.mclassdef.bound_mtype
- end
-
- # Prepare the `self` runtime variable to be used by the rest of
- # compilation steps.
- # Step 1
- protected fun resolve_receiver(v: VISITOR): RuntimeVariable
- do
- var casttype = mmethoddef.mclassdef.bound_mtype
- return new RuntimeVariable("self", recv_mtype, casttype)
- end
-
- # Builds the static frame for current runtime method
- # Step 2
- protected fun build_frame(v: VISITOR, arguments: Array[RuntimeVariable]): StaticFrame
- do
- return new StaticFrame(v, mmethoddef, recv_mtype.as(MClassType), arguments)
- end
-
- # Step 3 : Returns the return type used by the runtime function.
- protected fun resolve_return_mtype(v: VISITOR)
- do
- return_mtype = msignature.return_mtype
- end
-
- # Fills the argument array inside v.frame.arguments, calling `resolve_ith_parameter`
- # for each parameter.
- private fun fill_parameters(v: VISITOR)
- do
- assert v.frame != null
- for i in [0..msignature.arity[ do
- var arg = resolve_ith_parameter(v, i)
+ # Returns `true` if the associated `mmethoddef`'s return type isn't null,
+ # otherwise `false`.
+ fun has_return: Bool
+ do
+ return mmethoddef.msignature.return_mtype != null
+ end
+
+ # The current msignature to use when compiling : `signature_to_c` and `body_to_c`.
+ # This method is useful since most concrete implementation doesn't use the
+ # mmethoddef's signature. By providing a definition in the abstract class,
+ # subclasses can use any msignature.
+ fun msignature: MSignature
+ do
+ return mmethoddef.msignature.as(not null)
+ end
+
+ # The current receiver type to compile : `signature_to_c` and `body_to_c`.
+ # See `msignature` method for more information.
+ protected fun recv_mtype: MType
+ do
+ return mmethoddef.mclassdef.bound_mtype
+ end
+
+ # Prepare the `self` runtime variable to be used by the rest of
+ # compilation steps.
+ # Step 1
+ protected fun resolve_receiver(v: VISITOR): RuntimeVariable
+ do
+ var casttype = mmethoddef.mclassdef.bound_mtype
+ return new RuntimeVariable("self", recv_mtype, casttype)
+ end
+
+ # Builds the static frame for current runtime method
+ # Step 2
+ protected fun build_frame(v: VISITOR, arguments: Array[RuntimeVariable]): StaticFrame
+ do
+ return new StaticFrame(v, mmethoddef, recv_mtype.as(MClassType), arguments)
+ end
+
+ # Step 3 : Returns the return type used by the runtime function.
+ protected fun resolve_return_mtype(v: VISITOR)
+ do
+ return_mtype = msignature.return_mtype
+ end
+
+ # Fills the argument array inside v.frame.arguments, calling `resolve_ith_parameter`
+ # for each parameter.
+ private fun fill_parameters(v: VISITOR)
+ do
+ assert v.frame != null
+ for i in [0..msignature.arity[ do
+ var arg = resolve_ith_parameter(v, i)
v.frame.arguments.add(arg)
end
- end
+ end
- # Step 4 : Creates `RuntimeVariable` for each method argument.
- protected fun resolve_ith_parameter(v: VISITOR, i: Int): RuntimeVariable
- do
- var mp = msignature.mparameters[i]
- var mtype = mp.mtype
- if mp.is_vararg then
+ # Step 4 : Creates `RuntimeVariable` for each method argument.
+ protected fun resolve_ith_parameter(v: VISITOR, i: Int): RuntimeVariable
+ do
+ var mp = msignature.mparameters[i]
+ var mtype = mp.mtype
+ if mp.is_vararg then
mtype = v.mmodule.array_type(mtype)
end
- return new RuntimeVariable("p{i}", mtype, mtype)
- end
-
- # Generate the code for the signature with an open curly brace
- #
- # Returns the generated signature without a semicolon and curly brace,
- # e.g `RES f(T0 p0, T1 p1, ..., TN pN)`
- # Step 5
- protected fun signature_to_c(v: VISITOR): String
- do
- assert v.frame != null
- var arguments = v.frame.arguments
- var comment = new FlatBuffer
- var selfvar = v.frame.selfvar
- var c_ret = "void"
- if has_return then
- c_ret = "{return_mtype.ctype}"
- end
- var sig = new FlatBuffer
- sig.append("{c_ret} {c_name}({recv_mtype.ctype} self")
+ return new RuntimeVariable("p{i}", mtype, mtype)
+ end
+
+ # Generate the code for the signature with an open curly brace
+ #
+ # Returns the generated signature without a semicolon and curly brace,
+ # e.g `RES f(T0 p0, T1 p1, ..., TN pN)`
+ # Step 5
+ protected fun signature_to_c(v: VISITOR): String
+ do
+ assert v.frame != null
+ var arguments = v.frame.arguments
+ var comment = new FlatBuffer
+ var selfvar = v.frame.selfvar
+ var c_ret = "void"
+ if has_return then
+ c_ret = "{return_mtype.ctype}"
+ end
+ var sig = new FlatBuffer
+ sig.append("{c_ret} {c_name}({recv_mtype.ctype} self")
comment.append("({selfvar}: {selfvar.mtype}")
- for i in [0..arguments.length-1[ do
- # Skip the receiver
- var arg = arguments[i+1]
+ for i in [0..arguments.length-1[ do
+ # Skip the receiver
+ var arg = arguments[i+1]
comment.append(", {arg.mtype}")
- sig.append(", {arg.mtype.ctype} p{i}")
+ sig.append(", {arg.mtype.ctype} p{i}")
end
- sig.append(")")
+ sig.append(")")
comment.append(")")
- if has_return then
- comment.append(": {return_mtype.as(not null)}")
- end
- v.add_decl("/* method {self} for {comment} */")
- v.add_decl("{sig} \{")
- return sig.to_s
- end
-
- # How the concrete compiler will declare the method, e.g inside a global header file,
- # extern signature, etc.
- # Step 6
- protected fun declare_signature(v: VISITOR, signature: String) is abstract
-
- # Generate the code for the body without return statement at the end and
- # no curly brace.
- # Step 7
- protected fun body_to_c(v: VISITOR)
- do
- mmethoddef.compile_inside_to_c(v, v.frame.arguments)
- end
-
- # Hook called at the end of `compile_to_c` function. This function
- # is useful if you need to register any function compiled to c.
- # Step 8 (optional).
- protected fun end_compile_to_c(v: VISITOR)
- do
- # Nothing to do by default
- end
+ if has_return then
+ comment.append(": {return_mtype.as(not null)}")
+ end
+ v.add_decl("/* method {self} for {comment} */")
+ v.add_decl("{sig} \{")
+ return sig.to_s
+ end
+
+ # How the concrete compiler will declare the method, e.g inside a global header file,
+ # extern signature, etc.
+ # Step 6
+ protected fun declare_signature(v: VISITOR, signature: String) is abstract
+
+ # Generate the code for the body without return statement at the end and
+ # no curly brace.
+ # Step 7
+ protected fun body_to_c(v: VISITOR)
+ do
+ mmethoddef.compile_inside_to_c(v, v.frame.arguments)
+ end
+
+ # Hook called at the end of `compile_to_c` function. This function
+ # is useful if you need to register any function compiled to c.
+ # Step 8 (optional).
+ protected fun end_compile_to_c(v: VISITOR)
+ do
+ # Nothing to do by default
+ end
# Generate the code
- fun compile_to_c(compiler: COMPILER)
- do
- var v = compiler.new_visitor
- var selfvar = resolve_receiver(v)
- var arguments = [selfvar]
- var frame = build_frame(v, arguments)
- v.frame = frame
-
- resolve_return_mtype(v)
- fill_parameters(v)
-
- # WARNING: the signature must be declared before creating
- # any returnlabel and returnvar (`StaticFrame`). Otherwise,
- # you could end up with variable outside the function.
- var sig = signature_to_c(v)
- declare_signature(v, sig)
-
- frame.returnlabel = v.get_name("RET_LABEL")
- if has_return then
- var ret_mtype = return_mtype
- assert ret_mtype != null
- frame.returnvar = v.new_var(ret_mtype)
- end
-
- body_to_c(v)
- v.add("{frame.returnlabel.as(not null)}:;")
+ fun compile_to_c(compiler: COMPILER)
+ do
+ var v = compiler.new_visitor
+ var selfvar = resolve_receiver(v)
+ var arguments = [selfvar]
+ var frame = build_frame(v, arguments)
+ v.frame = frame
+
+ resolve_return_mtype(v)
+ fill_parameters(v)
+
+ # WARNING: the signature must be declared before creating
+ # any returnlabel and returnvar (`StaticFrame`). Otherwise,
+ # you could end up with variable outside the function.
+ var sig = signature_to_c(v)
+ declare_signature(v, sig)
+
+ frame.returnlabel = v.get_name("RET_LABEL")
+ if has_return then
+ var ret_mtype = return_mtype
+ assert ret_mtype != null
+ frame.returnvar = v.new_var(ret_mtype)
+ end
+
+ body_to_c(v)
+ v.add("{frame.returnlabel.as(not null)}:;")
if has_return then
v.add("return {frame.returnvar.as(not null)};")
end
- v.add "\}"
- end_compile_to_c(v)
- end
+ v.add "\}"
+ end_compile_to_c(v)
+ end
end
# Base class for all thunk-like function. A thunk is a function whose purpose
# its receiver is of type `Object`.
# In the same vibe, a call reference has all of its argument boxed as `Object`.
abstract class ThunkFunction
- super AbstractRuntimeFunction
-
- # Determines if the callsite should be polymorphic or static.
- var polymorph_call_flag = false is writable
-
- # The type expected by the callee. Used to resolve `mmethoddef`'s formal
- # parameters and virtual type. This type must NOT need anchor.
- fun target_recv: MType is abstract
-
- redef fun body_to_c(v)
- do
- assert not target_recv.need_anchor
- var frame = v.frame
- assert frame != null
- var selfvar = frame.selfvar
- var arguments = frame.arguments
- var arguments2 = new Array[RuntimeVariable]
- arguments2.push(v.autobox(selfvar, target_recv))
- var resolved_sig = msignature.resolve_for(target_recv, target_recv.as(MClassType), v.mmodule, true)
- for i in [0..resolved_sig.arity[ do
- var param = resolved_sig.mparameters[i]
- var mtype = param.mtype
- if param.is_vararg then
+ super AbstractRuntimeFunction
+
+ # Determines if the callsite should be polymorphic or static.
+ var polymorph_call_flag = false is writable
+
+ # The type expected by the callee. Used to resolve `mmethoddef`'s formal
+ # parameters and virtual type. This type must NOT need anchor.
+ fun target_recv: MType is abstract
+
+ redef fun body_to_c(v)
+ do
+ assert not target_recv.need_anchor
+ var frame = v.frame
+ assert frame != null
+ var selfvar = frame.selfvar
+ var arguments = frame.arguments
+ var arguments2 = new Array[RuntimeVariable]
+ arguments2.push(v.autobox(selfvar, target_recv))
+ var resolved_sig = msignature.resolve_for(target_recv, target_recv.as(MClassType), v.mmodule, true)
+ for i in [0..resolved_sig.arity[ do
+ var param = resolved_sig.mparameters[i]
+ var mtype = param.mtype
+ if param.is_vararg then
mtype = v.mmodule.array_type(mtype)
end
- var temp = v.autobox(arguments[i+1], mtype)
- arguments2.push(temp)
- end
- v.add("/* {mmethoddef}, {recv_mtype.ctype} */")
- var subret: nullable RuntimeVariable = null
- if polymorph_call_flag then
- subret = v.send(mmethoddef.mproperty, arguments2)
- else
- subret = v.call(mmethoddef, arguments2[0].mcasttype.as(MClassType), arguments2)
- end
- if has_return then
- assert subret != null
- var subret2 = v.autobox(subret, return_mtype.as(not null))
- v.assign(frame.returnvar.as(not null), subret2)
- end
-
- end
+ var temp = v.autobox(arguments[i+1], mtype)
+ arguments2.push(temp)
+ end
+ v.add("/* {mmethoddef}, {recv_mtype.ctype} */")
+ var subret: nullable RuntimeVariable = null
+ if polymorph_call_flag then
+ subret = v.send(mmethoddef.mproperty, arguments2)
+ else
+ subret = v.call(mmethoddef, arguments2[0].mcasttype.as(MClassType), arguments2)
+ end
+ if has_return then
+ assert subret != null
+ var subret2 = v.autobox(subret, return_mtype.as(not null))
+ v.assign(frame.returnvar.as(not null), subret2)
+ end
+
+ end
end
# The array comprehension currently filled, if any
private var comprehension: nullable RuntimeVariable = null
- # Returns the first argument (the receiver) of a frame.
- # REQUIRE: arguments.length >= 1
- fun selfvar: RuntimeVariable
- do
- assert arguments.length >= 1
- return arguments.first
- end
+ # Returns the first argument (the receiver) of a frame.
+ # REQUIRE: arguments.length >= 1
+ fun selfvar: RuntimeVariable
+ do
+ assert arguments.length >= 1
+ return arguments.first
+ end
end
redef class MType
var pname = mpropdef.mproperty.name
var cname = mpropdef.mclassdef.mclass.name
var ret = mpropdef.msignature.return_mtype
- if ret != null then
+ var compiler = v.compiler
+
+ # WARNING: we must not resolve the return type when it's a functional type.
+ # Otherwise, we get a compile error exactly here. Moreover, `routine_ref_call`
+ # already handles the return type. NOTE: this warning only apply when compiling
+ # in `semi-global`.
+ if ret != null and not compiler.all_routine_types_name.has(cname) then
ret = v.resolve_for(ret, arguments.first)
end
+
if pname != "==" and pname != "!=" then
v.adapt_signature(mpropdef, arguments)
v.unbox_signature_extern(mpropdef, arguments)
v.ret(v.new_expr("~{arguments[0]}", ret.as(not null)))
return true
end
+ else if compiler.all_routine_types_name.has(cname) then
+ v.routine_ref_call(mpropdef, arguments)
+ return true
end
if pname == "exit" then
v.add("exit((int){arguments[1]});")
v.supercall(mpropdef, arguments.first.mtype.as(MClassType), arguments)
end
return
+ else if mclassdef.default_init == mpropdef then
+ var recv = arguments.first
+ var initializers = mpropdef.initializers
+ var no_init = false
+ if not initializers.is_empty and not mpropdef.is_old_style_init then
+ var i = 1
+ for p in initializers do
+ if p isa MMethod then
+ var args = [recv]
+ for x in p.intro.msignature.mparameters do
+ args.add arguments[i]
+ i += 1
+ end
+ v.send(p, args)
+ if p.intro.is_calling_init then no_init = true
+ else if p isa MAttribute then
+ v.write_attribute(p, recv, arguments[i])
+ i += 1
+ else abort
+ end
+ assert i == arguments.length
+
+ end
+ if not no_init then v.send(mclass.the_root_init_mmethod.as(not null), [recv])
+ return
else
abort
end
var res = v.compile_callsite(callsite, args)
if is_safe then
if res != null then
- var orig_res = res
+ # `callsite.mpropdef` may reference a method whose
+ # return type is a primitive type in C. If it is
+ # the case, we must convert the primitive type to
+ # a `val*` to support nullable assignment.
+ # Autobox's job is to convert primitive type to
+ # nullable type, eg from `Int` to `nullable `Int`.
+ # The target type reside in `self.mtype`.
+ var original_res = v.autobox(res, self.mtype.as(not null))
+
+ # Here we must create a new_var in case the original
+ # type is not nullable. We can't call `autobox` to
+ # convert a complex type to its nullable version.
+ # eg if we have a type `A`, calling autobox like
+ # `autobox(A, nullable A)` will return `A` since
+ # `A` and `nullable A` have the same primitive
+ # type. The nullable qualifier is only used at
+ # compile time to add appropriate null checks.
res = v.new_var(self.mtype.as(not null))
- v.add("{res} = {orig_res};")
+ v.add("{res} = {original_res};")
v.add("\} else \{")
v.add("{res} = NULL;")
end
end
redef class ACallrefExpr
- redef fun expr(v)
- do
- v.add_abort("NOT YET IMPLEMENTED callref expressions.")
- return null
- end
+ redef fun expr(v)
+ do
+ var recv = v.expr(self.n_expr, null)
+ var res = v.routine_ref_instance(mtype.as(MClassType), recv, callsite.as(not null))
+ return res
+ end
end
redef class ASendReassignFormExpr
# option --global
var opt_global = new OptionBool("Use global compilation", "--global")
- var global_compiler_phase = new GlobalCompilerPhase(self, null)
+ var global_compiler_phase = new GlobalCompilerPhase(self, [contracts_phase])
redef init do
super
v.add_decl("{mtype.arguments.first.ctype} values[1];")
end
+ if all_routine_types_name.has(mtype.mclass.name) then
+ v.add_decl("val* recv;")
+ var c_args = ["val* self"]
+ var c_ret = "void"
+ var k = mtype.arguments.length
+ if mtype.mclass.name.has("Fun") then
+ c_ret = mtype.arguments.last.ctype
+ k -= 1
+ end
+ for i in [0..k[ do
+ var t = mtype.arguments[i]
+ c_args.push("{t.ctype} p{i}")
+ end
+ var c_sig = c_args.join(", ")
+ v.add_decl("{c_ret} (*method)({c_sig});")
+ end
+
if mtype.ctype_extern != "val*" then
# Is the Nit type is native then the struct is a box with two fields:
# * the `classid` to be polymorph
var v = self.new_visitor
var is_native_array = mtype.mclass.name == "NativeArray"
-
+ var is_routine_ref = all_routine_types_name.has(mtype.mclass.name)
var sig
if is_native_array then
sig = "int length"
else
sig = "void"
end
+ if is_routine_ref then
+ var c_args = ["val* self"]
+ var c_ret = "void"
+ var k = mtype.arguments.length
+ if mtype.mclass.name.has("Fun") then
+ c_ret = mtype.arguments.last.ctype
+ k -= 1
+ end
+ for i in [0..k[ do
+ var t = mtype.arguments[i]
+ c_args.push("{t.ctype} p{i}")
+ end
+ # The underlying method signature
+ var method_sig = "{c_ret} (*method)({c_args.join(", ")})"
+ sig = "val* recv, {method_sig}"
+ end
self.header.add_decl("{mtype.ctype} NEW_{mtype.c_name}({sig});")
v.add_decl("/* allocate {mtype} */")
else
v.add("{res} = nit_alloc(sizeof(struct {mtype.c_name}));")
end
+ if is_routine_ref then
+ v.add("((struct {mtype.c_name}*){res})->recv = recv;")
+ v.add("((struct {mtype.c_name}*){res})->method = method;")
+ end
v.add("{res}->classid = {self.classid(mtype)};")
self.generate_init_attr(v, res, mtype)
self.add("{recv}[{i}]={val};")
end
+ redef fun routine_ref_instance(routine_mclass_type, recv, callsite)
+ do
+ var mmethoddef = callsite.mpropdef
+ var method = new CustomizedRuntimeFunction(mmethoddef, recv.mcasttype.as(MClassType))
+ var my_recv = recv
+ if recv.mtype.is_c_primitive then
+ var object_type = mmodule.object_type
+ my_recv = autobox(recv, object_type)
+ end
+ var thunk = new CustomizedThunkFunction(mmethoddef, my_recv.mtype.as(MClassType))
+ thunk.polymorph_call_flag = not my_recv.is_exact
+ compiler.todo(method)
+ compiler.todo(thunk)
+ var ret_type = self.anchor(routine_mclass_type).as(MClassType)
+ var res = self.new_expr("NEW_{ret_type.c_name}({my_recv}, &{thunk.c_name})", ret_type)
+ return res
+ end
+
+ redef fun routine_ref_call(mmethoddef, arguments)
+ do
+ var routine = arguments.first
+ var routine_type = routine.mtype.as(MClassType)
+ var routine_class = routine_type.mclass
+ var underlying_recv = "((struct {routine.mcasttype.c_name}*){routine})->recv"
+ var underlying_method = "((struct {routine.mcasttype.c_name}*){routine})->method"
+ adapt_signature(mmethoddef, arguments)
+ arguments.shift
+ var ss = "{underlying_recv}"
+ if arguments.length > 0 then
+ ss = "{ss}, {arguments.join(", ")}"
+ end
+ arguments.unshift routine
+
+ var ret_mtype = mmethoddef.msignature.return_mtype
+
+ if ret_mtype != null then
+ ret_mtype = resolve_for(ret_mtype, routine)
+ end
+ var callsite = "{underlying_method}({ss})"
+ if ret_mtype != null then
+ var subres = new_expr("{callsite}", ret_mtype)
+ ret(subres)
+ else
+ add("{callsite};")
+ end
+ end
+
redef fun send(m, args)
do
var types = self.collect_types(args.first)
if ret != null then
ret = v.resolve_for(ret, arguments.first)
end
- if self.mmethoddef.can_inline(v) then
+
+ # TODO: remove this guard when gcc warning issue (#2781) is resolved
+ # WARNING: the next two lines of code is used to prevent inlining.
+ # Inlining of a callref seems to work all the time. However,
+ # it will produce some deadcode in certain scenarios (when using nullable type).
+ #
+ # ~~~~nitish
+ # class A[E]
+ # fun toto(x: E)
+ # do
+ # # ...do something with x...
+ # end
+ # end
+ # end
+ # var a = new A[nullable Int]
+ # var f = &a.toto
+ # f.call(null) # Will produce a proper C callsite, but it will
+ # # produce unreachable (dead code) for type checking
+ # # and covariance. Thus, creating warnings when
+ # # compiling in global. However, if you ignore
+ # # those warnings, the binary works perfectly fine.
+ # ~~~~
+ var intromclassdef = self.mmethoddef.mproperty.intro_mclassdef
+ var is_callref = v.compiler.all_routine_types_name.has(intromclassdef.name)
+
+ if self.mmethoddef.can_inline(v) and not is_callref then
var frame = new StaticFrame(v, self.mmethoddef, self.recv, arguments)
frame.returnlabel = v.get_name("RET_LABEL")
if ret != null then
end
end
end
+
+# Thunk implementation for global compiler.
+# For more detail see `abstract_compiler::ThunkFunction` documentation.
+class CustomizedThunkFunction
+ super ThunkFunction
+ super CustomizedRuntimeFunction
+
+ redef fun c_name
+ do
+ return "THUNK_" + super
+ end
+
+ redef fun hash
+ do
+ return super + c_name.hash
+ end
+
+ redef fun resolve_receiver(v)
+ do
+ var res = super(v)
+ if res.is_exact then res.is_exact = not polymorph_call_flag
+ return res
+ end
+
+ redef fun target_recv
+ do
+ # If the targeted method was introduced by a primitive type,
+ # then target_recv must be set to it. Otherwise, there will
+ # be a missing cast. Here's an example:
+ #
+ # ~~~~nitish
+ # class Int
+ # fun mult_by(x:Int):Int do return x * self
+ # end
+ #
+ # var f = &10.mult_by
+ # ~~~~
+ # Here the thunk `f` must box the receiver `10` into an object.
+ # This is due to the memory representation of a call ref which
+ # has a pointer to an opaque type `val*`:
+ #
+ # ```C
+ # struct Mult_by_callref_struct {
+ # classid;
+ # // The receiver `10` would be here
+ # val* recv;
+ # // the targeted receiver is a `long`
+ # long (*pointer_to_mult_by)(long, long);
+ # }
+ # ```
+ #
+ # Thus, every primitive type must be boxed into an `Object` when
+ # instantiating a callref.
+ #
+ # However, if the underlying method was introduced by a primitive
+ # type then a cast must be invoked to convert our boxed receiver
+ # to its original primitive type.
+ var intro_recv = mmethoddef.mproperty.intro_mclassdef.bound_mtype
+ if intro_recv.is_c_primitive then
+ return intro_recv
+ end
+ return recv_mtype
+ end
+end
# This method is used to manage varargs in signatures and returns the real array
# of runtime variables to use in the call.
fun varargize(mpropdef: MMethodDef, map: nullable SignatureMap, recv: RuntimeVariable, args: SequenceRead[AExpr]): Array[RuntimeVariable] do
- var msignature = mpropdef.new_msignature or else mpropdef.msignature.as(not null)
+ var msignature = mpropdef.msignature.as(not null)
var res = new Array[RuntimeVariable]
res.add(recv)
end
end
- var separate_compiler_phase = new SeparateCompilerPhase(self, null)
+ var separate_compiler_phase = new SeparateCompilerPhase(self, [contracts_phase])
end
class SeparateCompilerPhase
private var type_ids: Map[MType, Int] is noinit
private var type_colors: Map[MType, Int] is noinit
private var opentype_colors: Map[MType, Int] is noinit
+ private var thunks_to_compile: Set[SeparateRuntimeFunction] = new HashSet[SeparateRuntimeFunction]
init do
var file = new_file("nit.common")
compiler.compile_types
end
+ fun thunk_todo(thunk: SeparateRuntimeFunction)
+ do
+ # Concrete instance of `SeparateRuntimeFunction` are already
+ # handled by the compiler. Avoid duplicate compilation.
+ if thunk isa SeparateThunkFunction then
+ thunks_to_compile.add(thunk)
+ end
+ end
+
# Color and compile type structures and cast information
fun compile_types
do
# Collect all bas box class
# FIXME: this is not completely fine with a separate compilation scheme
for classname in ["Int", "Bool", "Byte", "Char", "Float", "CString",
- "Pointer", "Int8", "Int16", "UInt16", "Int32", "UInt32"] do
+ "Pointer", "Int8", "Int16", "UInt16", "Int32", "UInt32"] do
var classes = self.mainmodule.model.get_mclasses_by_name(classname)
if classes == null then continue
assert classes.length == 1 else print_error classes.join(", ")
else
return self.box_kinds[mclass]
end
-
end
fun compile_color_consts(colors: Map[Object, Int]) do
attr_tables[mclass] = attr_colorer.build_layout(mclass)
end
-
end
# colorize live types of the program
return tables
end
-
private fun compute_type_test_layouts(mtypes: Set[MClassType], cast_types: Set[MType]) do
# Group cast_type by their classes
var bucklets = new HashMap[MClass, Set[MType]]
end
end
end
+ var compiled_thunks = new Array[SeparateRuntimeFunction]
+ # Compile thunks here to write them in the same module they are declared.
+ for thunk in thunks_to_compile do
+ if thunk.mmethoddef.mclassdef.mmodule == mmodule then
+ thunk.compile_to_c(self)
+ compiled_thunks.add(thunk)
+ end
+ end
+ thunks_to_compile.remove_all(compiled_thunks)
self.mainmodule = old_module
end
v.add_decl("\};")
end
- # Globally compile the table of the class mclass
- # In a link-time optimisation compiler, tables are globally computed
- # In a true separate compiler (a with dynamic loading) you cannot do this unfortnally
- fun compile_class_to_c(mclass: MClass)
+ protected fun compile_class_vft(ccinfo: ClassCompilationInfo, v: SeparateCompilerVisitor)
do
- if mclass.is_broken then return
-
- var mtype = mclass.intro.bound_mtype
- var c_name = mclass.c_name
-
- var v = new_visitor
-
+ var mclass = ccinfo.mclass
+ var mtype = ccinfo.mtype
var rta = runtime_type_analysis
- var is_dead = rta != null and not rta.live_classes.has(mclass)
- # While the class may be dead, some part of separately compiled code may use symbols associated to the class, so
- # in order to compile and link correctly the C code, these symbols should be declared and defined.
- var need_corpse = is_dead and mtype.is_c_primitive or mclass.kind == extern_kind or mclass.kind == enum_kind
+ var c_name = ccinfo.mclass.c_name
+ var is_dead = ccinfo.is_dead
+ var need_corpse = ccinfo.need_corpse
v.add_decl("/* runtime class {c_name}: {mclass.full_name} (dead={is_dead}; need_corpse={need_corpse})*/")
v.add_decl("\}")
v.add_decl("\};")
end
+ end
+
+ # Given a `MClass`, if it's a universal class and if it needs to be handle
+ # specifically by the compiler, this function will compile it and return
+ # true. Otherwise, no C code will be written in the visitor and the value
+ # false will be returned.
+ fun compile_class_if_universal(ccinfo: ClassCompilationInfo, v: SeparateCompilerVisitor): Bool
+ do
+ var mclass = ccinfo.mclass
+ var mtype = ccinfo.mtype
+ var c_name = ccinfo.mclass.c_name
+ var is_dead = ccinfo.is_dead
+ var need_corpse = ccinfo.need_corpse
if mtype.is_c_primitive or mtype.mclass.name == "Pointer" then
# Is a primitive type or the Pointer class, not any other extern class
- if mtype.is_tagged then return
+ if mtype.is_tagged then return true
#Build instance struct
self.header.add_decl("struct instance_{c_name} \{")
self.header.add_decl("\};")
# Pointer is needed by extern types, live or not
- if is_dead and mtype.mclass.name != "Pointer" then return
+ if is_dead and mtype.mclass.name != "Pointer" then return true
#Build BOX
self.provide_declaration("BOX_{c_name}", "val* BOX_{c_name}({mtype.ctype_extern});")
v.add("\}")
# A Pointer class also need its constructor
- if mtype.mclass.name != "Pointer" then return
+ if mtype.mclass.name != "Pointer" then return true
v = new_visitor
self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}(const struct type* type);")
v.add("return {res};")
end
v.add("\}")
- return
+ return true
else if mclass.name == "NativeArray" then
#Build instance struct
self.header.add_decl("struct instance_{c_name} \{")
v.add("{res}->length = length;")
v.add("return (val*){res};")
v.add("\}")
- return
+ return true
+ else if mclass.name == "RoutineRef" then
+ self.header.add_decl("struct instance_{c_name} \{")
+ self.header.add_decl("const struct type *type;")
+ self.header.add_decl("const struct class *class;")
+ self.header.add_decl("val* recv;")
+ self.header.add_decl("nitmethod_t method;")
+ self.header.add_decl("\};")
+
+ self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}(val* recv, nitmethod_t method, const struct class* class, const struct type* type);")
+ v.add_decl("/* allocate {mtype} */")
+ v.add_decl("{mtype.ctype} NEW_{c_name}(val* recv, nitmethod_t method, const struct class* class, const struct type* type)\{")
+ var res = v.get_name("self")
+ v.add_decl("struct instance_{c_name} *{res};")
+ var alloc = v.nit_alloc("sizeof(struct instance_{c_name})", mclass.full_name)
+ v.add("{res} = {alloc};")
+ v.add("{res}->type = type;")
+ hardening_live_type(v, "type")
+ v.add("{res}->class = class;")
+ v.add("{res}->recv = recv;")
+ v.add("{res}->method = method;")
+ v.add("return (val*){res};")
+ v.add("\}")
+ return true
else if mtype.mclass.kind == extern_kind and mtype.mclass.name != "CString" then
# Is an extern class (other than Pointer and CString)
# Pointer is caught in a previous `if`, and CString is internal
v.add("return {res};")
end
v.add("\}")
- return
+ return true
end
+ return false
+ end
+
+ protected fun compile_default_new(ccinfo: ClassCompilationInfo, v: SeparateCompilerVisitor)
+ do
+ var mclass = ccinfo.mclass
+ var mtype = ccinfo.mtype
+ var c_name = ccinfo.mclass.c_name
+ var is_dead = ccinfo.is_dead
#Build NEW
self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}(const struct type* type);")
v.add("return {res};")
end
v.add("\}")
+
+ end
+
+ protected fun build_class_compilation_info(mclass: MClass): ClassCompilationInfo
+ do
+ var mtype = mclass.intro.bound_mtype
+ var rta = runtime_type_analysis
+ var is_dead = rta != null and not rta.live_classes.has(mclass)
+
+ # While the class may be dead, some part of separately compiled code may use symbols associated to the class, so
+ # in order to compile and link correctly the C code, these symbols should be declared and defined.
+ var need_corpse = is_dead and mtype.is_c_primitive or mclass.kind == extern_kind or mclass.kind == enum_kind
+
+ var compilation_info = new ClassCompilationInfo(mclass, is_dead, need_corpse)
+ return compilation_info
+ end
+
+ # Globally compile the table of the class mclass
+ # In a link-time optimisation compiler, tables are globally computed
+ # In a true separate compiler (a with dynamic loading) you cannot do this unfortnally
+ fun compile_class_to_c(mclass: MClass)
+ do
+ var v = new_visitor
+ var class_info = build_class_compilation_info(mclass)
+ compile_class_vft(class_info, v)
+ var is_already_managed = compile_class_if_universal(class_info, v)
+ if not is_already_managed then
+ compile_default_new(class_info, v)
+ end
end
# Compile structures used to map tagged primitive values to their classes and types.
self.add("{recv}[{i}]={val};")
end
+ redef fun routine_ref_instance(routine_type, recv, callsite)
+ do
+ #debug "ENTER ref_instance"
+ var mmethoddef = callsite.mpropdef
+ var mmethod = mmethoddef.mproperty
+ # routine_mclass is the specialized one, e.g: FunRef1, ProcRef2, etc..
+ var routine_mclass = routine_type.mclass
+
+ var nclasses = mmodule.model.get_mclasses_by_name("RoutineRef").as(not null)
+ var base_routine_mclass = nclasses.first
+
+ # All routine classes use the same `NEW` constructor.
+ # However, they have different declared `class` and `type` value.
+ self.require_declaration("NEW_{base_routine_mclass.c_name}")
+
+ var recv_class_cname = recv.mcasttype.as(MClassType).mclass.c_name
+ var my_recv = recv
+
+ if recv.mtype.is_c_primitive then
+ my_recv = autobox(recv, mmodule.object_type)
+ end
+ var my_recv_mclass_type = my_recv.mtype.as(MClassType)
+
+ # The class of the concrete Routine must exist (e.g ProcRef0, FunRef0, etc.)
+ self.require_declaration("class_{routine_mclass.c_name}")
+ self.require_declaration(mmethoddef.c_name)
+
+ var thunk_function = mmethoddef.callref_thunk(my_recv_mclass_type)
+ # If the receiver is exact, then there's no need to make a
+ # polymorph call to the underlying method.
+ thunk_function.polymorph_call_flag = not my_recv.is_exact
+ var runtime_function = mmethoddef.virtual_runtime_function
+
+ var is_c_equiv = runtime_function.msignature.c_equiv(thunk_function.msignature)
+
+ var c_ref = thunk_function.c_ref
+ if is_c_equiv then
+ var const_color = mmethoddef.mproperty.const_color
+ c_ref = "{class_info(my_recv)}->vft[{const_color}]"
+ self.require_declaration(const_color)
+ else
+ self.require_declaration(thunk_function.c_name)
+ compiler.thunk_todo(thunk_function)
+ end
+ var res: RuntimeVariable
+ if routine_type.need_anchor then
+ hardening_live_open_type(routine_type)
+ link_unresolved_type(self.frame.mpropdef.mclassdef, routine_type)
+ var recv2 = self.frame.arguments.first
+ var recv2_type_info = self.type_info(recv2)
+ self.require_declaration(routine_type.const_color)
+ res = self.new_expr("NEW_{base_routine_mclass.c_name}({my_recv}, (nitmethod_t){c_ref}, &class_{routine_mclass.c_name}, {recv2_type_info}->resolution_table->types[{routine_type.const_color}])", routine_type)
+ else
+ self.require_declaration("type_{routine_type.c_name}")
+ compiler.undead_types.add(routine_type)
+ res = self.new_expr("NEW_{base_routine_mclass.c_name}({my_recv}, (nitmethod_t){c_ref}, &class_{routine_mclass.c_name}, &type_{routine_type.c_name})", routine_type)
+ end
+ return res
+ end
+
+ redef fun routine_ref_call(mmethoddef, arguments)
+ do
+ #debug "ENTER ref_call"
+ compiler.modelbuilder.nb_invok_by_tables += 1
+ if compiler.modelbuilder.toolcontext.opt_invocation_metrics.value then add("count_invoke_by_tables++;")
+ var nclasses = mmodule.model.get_mclasses_by_name("RoutineRef").as(not null)
+ var nclass = nclasses.first
+ var runtime_function = mmethoddef.virtual_runtime_function
+
+ # Save the current receiver since adapt_signature will autobox
+ # the routine receiver which is not the underlying receiver.
+ # The underlying receiver has already been adapted in the
+ # `routine_ref_instance` method. Here we just want to adapt the
+ # rest of the signature, but it's easier to pass the wrong
+ # receiver in adapt_signature then discards it with `shift`.
+ #
+ # ~~~~nitish
+ # class A; def toto do print "toto"; end
+ # var a = new A
+ # var f = &a.toto # `a` is the underlying receiver
+ # f.call # here `f` is the routine receiver
+ # ~~~~
+ var routine = arguments.first
+
+ # Retrieve the concrete routine type
+ var original_recv_c = "(((struct instance_{nclass.c_name}*){arguments[0]})->recv)"
+ var nitmethod = "(({runtime_function.c_funptrtype})(((struct instance_{nclass.c_name}*){arguments[0]})->method))"
+ if arguments.length > 1 then
+ adapt_signature(mmethoddef, arguments)
+ end
+
+ var ret_mtype = runtime_function.called_signature.return_mtype
+
+ if ret_mtype != null then
+ # `ret` is actually always nullable Object. When invoking
+ # a callref, we don't have the original callsite information.
+ # Thus, we need to recompute the return type of the callsite.
+ ret_mtype = resolve_for(ret_mtype, routine)
+ end
+
+ # remove the routine's receiver
+ arguments.shift
+ var ss = arguments.join(", ")
+ # replace the receiver with the original one
+ if arguments.length > 0 then
+ ss = "{original_recv_c}, {ss}"
+ else
+ ss = original_recv_c
+ end
+
+ arguments.unshift routine # put back the routine ref receiver
+ add "/* {mmethoddef.mproperty} on {arguments.first.inspect}*/"
+ var callsite = "{nitmethod}({ss})"
+ if ret_mtype != null then
+ var subres = new_expr("{callsite}", ret_mtype)
+ ret(subres)
+ else
+ add("{callsite};")
+ end
+ end
+
fun link_unresolved_type(mclassdef: MClassDef, mtype: MType) do
assert mtype.need_anchor
var compiler = self.compiler
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
self.virtual_runtime_function_cache = res
return res
end
- res = new SeparateThunkFunction(self, recv, msignature, "VIRTUAL_{c_name}", mclassdef.bound_mtype)
+ res = new SeparateThunkFunction(self, recv, msignature, "VIRTUAL_{c_name}", mclassdef.bound_mtype)
end
return res
end
redef fun to_s do return self.mmethoddef.to_s
- redef fun msignature
- do
- return called_signature
- end
+ redef fun msignature
+ do
+ return called_signature
+ end
- redef fun recv_mtype
- do
- return called_recv
- end
+ redef fun recv_mtype
+ do
+ return called_recv
+ end
- redef fun return_mtype
- do
- return called_signature.return_mtype
- end
+ redef fun return_mtype
+ do
+ return called_signature.return_mtype
+ end
# The C return type (something or `void`)
var c_ret: String is lazy do
# The C type for the function pointer.
var c_funptrtype: String is lazy do return "{c_ret}(*){c_sig}"
- redef fun declare_signature(v, sig)
- do
- v.compiler.provide_declaration(c_name, "{sig};")
- end
+ redef fun declare_signature(v, sig)
+ do
+ v.compiler.provide_declaration(c_name, "{sig};")
+ end
- redef fun body_to_c(v)
- do
- var rta = v.compiler.as(SeparateCompiler).runtime_type_analysis
- if rta != null and not rta.live_mmodules.has(mmethoddef.mclassdef.mmodule) then
+ redef fun body_to_c(v)
+ do
+ var rta = v.compiler.as(SeparateCompiler).runtime_type_analysis
+ if rta != null and not rta.live_mmodules.has(mmethoddef.mclassdef.mmodule) then
v.add_abort("FATAL: Dead method executed.")
- else
- super
- end
- end
-
+ else
+ super
+ end
+ end
- redef fun end_compile_to_c(v)
- do
- var compiler = v.compiler
- compiler.names[self.c_name] = "{mmethoddef.full_name} ({mmethoddef.location.file.filename}:{mmethoddef.location.line_start})"
- end
+ redef fun end_compile_to_c(v)
+ do
+ var compiler = v.compiler
+ compiler.names[self.c_name] = "{mmethoddef.full_name} ({mmethoddef.location.file.filename}:{mmethoddef.location.line_start})"
+ end
- redef fun build_frame(v, arguments)
- do
- var recv = mmethoddef.mclassdef.bound_mtype
- return new StaticFrame(v, mmethoddef, recv, arguments)
- end
+ redef fun build_frame(v, arguments)
+ do
+ var recv = mmethoddef.mclassdef.bound_mtype
+ return new StaticFrame(v, mmethoddef, recv, arguments)
+ end
# Compile the trampolines used to implement late-binding.
#
end
end
+# Encapsulates every information needed to compile a class.
+#
+# The compilation of a class is done by several methods, two of those are
+# mandatory :
+# - compile_class_to_c : starts the compilation process
+# - compile_class_vft : generate the virtual function table
+# And one of them is optional :
+# - compile_class_if_universal : compiles the rest of the class if its a universal
+# type. Universal type are handle in a case-basis, this is why they need special treatment.
+# Generally, universal class will have special structure and a custom allocator.
+#
+# Throughout each step of the class compilation process, some information must be share.
+# This class encapsulates the compilation process state.
+# (except vft), eg
+class ClassCompilationInfo
+ var mclass: MClass # class to compile
+ var is_dead: Bool
+ var need_corpse: Bool
+
+ # Shortcut to access the class's bound type.
+ var mtype: MClassType is noinit
+
+ init
+ do
+ mtype = mclass.intro.bound_mtype
+ end
+end
+
class SeparateThunkFunction
- super ThunkFunction
- super SeparateRuntimeFunction
- redef var target_recv
+ super ThunkFunction
+ super SeparateRuntimeFunction
+ redef var target_recv
end
redef class MType
end
end
- var erasure_compiler_phase = new ErasureCompilerPhase(self, null)
+ var erasure_compiler_phase = new ErasureCompilerPhase(self, [contracts_phase])
end
class ErasureCompilerPhase
self.header.add_decl("typedef struct instance \{ const struct class *class; nitattribute_t attrs[1]; \} val; /* general C type representing a Nit instance. */")
end
- redef fun compile_class_to_c(mclass: MClass)
+ redef fun compile_class_if_universal(ccinfo, v)
do
- var mtype = mclass.intro.bound_mtype
+ var mclass = ccinfo.mclass
+ var mtype = ccinfo.mtype
var c_name = mclass.c_name
-
- var class_table = self.class_tables[mclass]
- var v = self.new_visitor
-
- var rta = runtime_type_analysis
- var is_dead = false # mclass.kind == abstract_kind or mclass.kind == interface_kind
- if not is_dead and rta != null and not rta.live_classes.has(mclass) and not mtype.is_c_primitive and mclass.name != "NativeArray" then
- is_dead = true
- end
-
- v.add_decl("/* runtime class {c_name} */")
-
- self.provide_declaration("class_{c_name}", "extern const struct class class_{c_name};")
- v.add_decl("extern const struct type_table type_table_{c_name};")
-
- # Build class vft
- v.add_decl("const struct class class_{c_name} = \{")
- v.add_decl("{class_ids[mclass]},")
- v.add_decl("\"{mclass.name}\", /* class_name_string */")
- v.add_decl("{self.box_kind_of(mclass)}, /* box_kind */")
- v.add_decl("{class_colors[mclass]},")
- if not is_dead then
- if build_class_vts_table(mclass) then
- v.require_declaration("vts_table_{c_name}")
- v.add_decl("&vts_table_{c_name},")
- else
- v.add_decl("NULL,")
- end
- v.add_decl("&type_table_{c_name},")
- v.add_decl("\{")
- var vft = self.method_tables.get_or_null(mclass)
- if vft != null then for i in [0 .. vft.length[ do
- var mpropdef = vft[i]
- if mpropdef == null then
- v.add_decl("NULL, /* empty */")
- else
- assert mpropdef isa MMethodDef
- if rta != null and not rta.live_methoddefs.has(mpropdef) then
- v.add_decl("NULL, /* DEAD {mclass.intro_mmodule}:{mclass}:{mpropdef} */")
- continue
- end
- var rf = mpropdef.virtual_runtime_function
- v.require_declaration(rf.c_name)
- v.add_decl("(nitmethod_t){rf.c_name}, /* pointer to {mpropdef.full_name} */")
- end
- end
- v.add_decl("\}")
- end
- v.add_decl("\};")
-
- # Build class type table
-
- v.add_decl("const struct type_table type_table_{c_name} = \{")
- v.add_decl("{class_table.length},")
- v.add_decl("\{")
- for msuper in class_table do
- if msuper == null then
- v.add_decl("-1, /* empty */")
- else
- v.add_decl("{self.class_ids[msuper]}, /* {msuper} */")
- end
- end
- v.add_decl("\}")
- v.add_decl("\};")
+ var is_dead = ccinfo.is_dead
if mtype.is_c_primitive or mtype.mclass.name == "Pointer" then
#Build instance struct
v.add("return (val*)res;")
v.add("\}")
- if mtype.mclass.name != "Pointer" then return
+ if mtype.mclass.name != "Pointer" then return true
v = new_visitor
self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}();")
v.add("return {res};")
end
v.add("\}")
- return
+ return true
else if mclass.name == "NativeArray" then
#Build instance struct
self.header.add_decl("struct instance_{c_name} \{")
v.add("{res}->length = length;")
v.add("return (val*){res};")
v.add("\}")
- return
+ return true
+ else if mclass.name == "RoutineRef" then
+ self.header.add_decl("struct instance_{c_name} \{")
+ self.header.add_decl("const struct class *class;")
+ self.header.add_decl("val* recv;")
+ self.header.add_decl("nitmethod_t method;")
+ self.header.add_decl("\};")
+
+ self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}(val* recv, nitmethod_t method, const struct class* class);")
+ v.add_decl("/* allocate {mtype} */")
+ v.add_decl("{mtype.ctype} NEW_{c_name}(val* recv, nitmethod_t method, const struct class* class)\{")
+ var res = v.get_name("self")
+ v.add_decl("struct instance_{c_name} *{res};")
+ var alloc = v.nit_alloc("sizeof(struct instance_{c_name})", mclass.full_name)
+ v.add("{res} = {alloc};")
+ v.add("{res}->class = class;")
+ v.add("{res}->recv = recv;")
+ v.add("{res}->method = method;")
+ v.add("return (val*){res};")
+ v.add("\}")
+ return true
else if mtype.mclass.kind == extern_kind and mtype.mclass.name != "CString" then
var pointer_type = mainmodule.pointer_type
v.add("return {res};")
end
v.add("\}")
- return
+ return true
end
+ return false
+ end
+
+ redef fun compile_class_vft(ccinfo, v)
+ do
+ var mclass = ccinfo.mclass
+ var mtype = ccinfo.mtype
+ var c_name = mclass.c_name
+ var is_dead = ccinfo.is_dead
+ var rta = runtime_type_analysis
+
+ # Build class vft
+ self.provide_declaration("class_{c_name}", "extern const struct class class_{c_name};")
+
+ v.add_decl("const struct class class_{c_name} = \{")
+ v.add_decl("{class_ids[mclass]},")
+ v.add_decl("\"{mclass.name}\", /* class_name_string */")
+ v.add_decl("{self.box_kind_of(mclass)}, /* box_kind */")
+ v.add_decl("{class_colors[mclass]},")
+ if not is_dead then
+ if build_class_vts_table(mclass) then
+ v.require_declaration("vts_table_{c_name}")
+ v.add_decl("&vts_table_{c_name},")
+ else
+ v.add_decl("NULL,")
+ end
+ v.add_decl("&type_table_{c_name},")
+ v.add_decl("\{")
+ var vft = self.method_tables.get_or_null(mclass)
+ if vft != null then for i in [0 .. vft.length[ do
+ var mpropdef = vft[i]
+ if mpropdef == null then
+ v.add_decl("NULL, /* empty */")
+ else
+ assert mpropdef isa MMethodDef
+ if rta != null and not rta.live_methoddefs.has(mpropdef) then
+ v.add_decl("NULL, /* DEAD {mclass.intro_mmodule}:{mclass}:{mpropdef} */")
+ continue
+ end
+ var rf = mpropdef.virtual_runtime_function
+ v.require_declaration(rf.c_name)
+ v.add_decl("(nitmethod_t){rf.c_name}, /* pointer to {mpropdef.full_name} */")
+ end
+ end
+ v.add_decl("\}")
+ end
+ v.add_decl("\};")
+ end
+
+ protected fun compile_class_type_table(ccinfo: ClassCompilationInfo, v: SeparateCompilerVisitor)
+ do
+ var mclass = ccinfo.mclass
+ var c_name = mclass.c_name
+ var class_table = self.class_tables[mclass]
+
+ # Build class type table
+ v.add_decl("const struct type_table type_table_{c_name} = \{")
+ v.add_decl("{class_table.length},")
+ v.add_decl("\{")
+ for msuper in class_table do
+ if msuper == null then
+ v.add_decl("-1, /* empty */")
+ else
+ v.add_decl("{self.class_ids[msuper]}, /* {msuper} */")
+ end
+ end
+ v.add_decl("\}")
+ v.add_decl("\};")
+ end
+
+ redef fun compile_default_new(ccinfo, v)
+ do
+ var mclass = ccinfo.mclass
+ var mtype = ccinfo.mtype
+ var c_name = mclass.c_name
+ var is_dead = ccinfo.is_dead
#Build NEW
self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}(void);")
v.add("\}")
end
+ redef fun build_class_compilation_info(mclass)
+ do
+ var ccinfo = super
+ var mtype = ccinfo.mtype
+ var rta = runtime_type_analysis
+ var is_dead = false # mclass.kind == abstract_kind or mclass.kind == interface_kind
+ if not is_dead and rta != null and not rta.live_classes.has(mclass) and not mtype.is_c_primitive and mclass.name != "NativeArray" then
+ is_dead = true
+ end
+ ccinfo.is_dead = is_dead
+ return ccinfo
+ end
+
+ redef fun compile_class_to_c(mclass: MClass)
+ do
+ var ccinfo = build_class_compilation_info(mclass)
+ var v = new_visitor
+ v.add_decl("/* runtime class {mclass.c_name} */")
+ self.provide_declaration("class_{mclass.c_name}", "extern const struct class class_{mclass.c_name};")
+ v.add_decl("extern const struct type_table type_table_{mclass.c_name};")
+ self.compile_class_vft(ccinfo, v)
+ self.compile_class_type_table(ccinfo, v)
+ if not self.compile_class_if_universal(ccinfo, v) then
+ self.compile_default_new(ccinfo, v)
+ end
+ end
+
private fun build_class_vts_table(mclass: MClass): Bool do
if self.vt_tables[mclass].is_empty then return false
self.add("{res} = NEW_{nclass.c_name}({length});")
return res
end
+
+ redef fun routine_ref_instance(routine_type, recv, callsite)
+ do
+ var mmethoddef = callsite.mpropdef
+ #debug "ENTER ref_instance"
+ var mmethod = mmethoddef.mproperty
+ # routine_mclass is the specialized one, e.g: FunRef1, ProcRef2, etc..
+ var routine_mclass = routine_type.mclass
+
+ var nclasses = mmodule.model.get_mclasses_by_name("RoutineRef").as(not null)
+ var base_routine_mclass = nclasses.first
+
+ # All routine classes use the same `NEW` constructor.
+ # However, they have different declared `class` and `type` value.
+ self.require_declaration("NEW_{base_routine_mclass.c_name}")
+
+ var recv_class_cname = recv.mcasttype.as(MClassType).mclass.c_name
+ var my_recv = recv
+
+ if recv.mtype.is_c_primitive then
+ my_recv = autobox(recv, mmodule.object_type)
+ end
+ var my_recv_mclass_type = my_recv.mtype.as(MClassType)
+
+ # The class of the concrete Routine must exist (e.g ProcRef0, FunRef0, etc.)
+ self.require_declaration("class_{routine_mclass.c_name}")
+
+ self.require_declaration(mmethoddef.c_name)
+
+ var thunk_function = mmethoddef.callref_thunk(my_recv_mclass_type)
+ var runtime_function = mmethoddef.virtual_runtime_function
+
+ var is_c_equiv = runtime_function.msignature.c_equiv(thunk_function.msignature)
+
+ var c_ref = thunk_function.c_ref
+ if is_c_equiv then
+ var const_color = mmethoddef.mproperty.const_color
+ c_ref = "{class_info(my_recv)}->vft[{const_color}]"
+ self.require_declaration(const_color)
+ else
+ self.require_declaration(thunk_function.c_name)
+ compiler.thunk_todo(thunk_function)
+ end
+ compiler.thunk_todo(thunk_function)
+
+ # Each RoutineRef points to a receiver AND a callref_thunk
+ var res = self.new_expr("NEW_{base_routine_mclass.c_name}({my_recv}, (nitmethod_t){c_ref}, &class_{routine_mclass.c_name})", routine_type)
+ #debug "LEAVING ref_instance"
+ return res
+
+ end
end
# FIXME Split the module in three parts: extension of the modele, building phase and the "re-driving"
module contracts
-import astbuilder
import parse_annotations
import phase
import semantize
+intrude import model_contract
+intrude import astbuilder
intrude import modelize_property
intrude import scope
intrude import typing
private class ContractsPhase
super Phase
- # The entry point of the contract phase
- # In reality, the contract phase is executed on each module
- # FIXME: Actually all method is checked to add method if any contract is inherited
redef fun process_nmodule(nmodule)do
# Check if the contracts are disabled
if toolcontext.opt_no_contract.value then return
nmodule.do_contracts(self.toolcontext)
end
+
+ redef fun process_mainmodule(mainmodule: MModule, given_mmodules: SequenceRead[MModule]) do
+ # Visit all loaded modules `toolcontext.nmodules` to do contract weaving
+ for nmodule in toolcontext.modelbuilder.nmodules do
+ nmodule.do_weaving_contracts(self.toolcontext)
+ end
+ end
end
redef class AModule
- # Compile all contracts
- #
- # The implementation of the contracts is done in two visits.
- #
- # - First step, the visitor analyzes and constructs the contracts
- # for each class (invariant) and method (expects, ensures).
- #
- # - Second step the visitor analyzes each `ASendExpr` to see
- # if the callsite calls a method with a contract. If this is
- # the case the callsite is replaced by another callsite to the contract method.
+
+ # Entry point to generate the entire contract infrastructure.
+ # Once this method is called we must call the `do_weaving_contracts` method (see it for more information).
fun do_contracts(toolcontext: ToolContext) do
+ var ast_builder = new ASTBuilder(mmodule.as(not null))
#
- var contract_visitor = new ContractsVisitor(toolcontext, toolcontext.modelbuilder.identified_modules.first, self, new ASTBuilder(mmodule.as(not null)))
+ var contract_visitor = new ContractsVisitor(toolcontext, toolcontext.modelbuilder.identified_modules.first, self, ast_builder)
contract_visitor.enter_visit(self)
- #
- var callsite_visitor = new CallSiteVisitor(toolcontext)
+ end
+
+ # Entry point to execute the weaving in order to redirect the calls to the contract sides if it's needed.
+ fun do_weaving_contracts(toolcontext: ToolContext)
+ do
+ var ast_builder = new ASTBuilder(mmodule.as(not null))
+ var callsite_visitor = new CallSiteVisitor(toolcontext, ast_builder)
callsite_visitor.enter_visit(self)
end
end
-# This visitor checks the `AMethPropdef` and the `AClassDef` to check if they have a contract annotation or it's a redefinition with a inheritance contract
+# Visitor to build all contracts.
private class ContractsVisitor
super Visitor
+ # Instance of the toolcontext
var toolcontext: ToolContext
# The main module
var current_location: Location is noinit
# Is the contrat is an introduction or not?
+ # This attribute has the same value as the `is_intro` of the propdef attached to the contract.
+ # Note : For MClassDef `is_intro_contract == false`. This is due to the fact that a method for checking invariants is systematically added to the root object class.
var is_intro_contract: Bool is noinit
# Actual visited class
# is `no_contract` annotation was found
var find_no_contract = false
+ # The reference to the `in_contract` attribute.
+ # This attribute is used to disable contract verification when you are already in a contract verification.
+ # Keep the `in_contract` attribute to avoid searching at each contrat
+ var in_contract_attribute: nullable MAttribute = null
+
redef fun visit(node)
do
node.create_contracts(self)
end
# Define the new contract take in consideration that an old contract exist or not
- private fun build_contract(n_annotation: AAnnotation, mcontract: MContract, mclassdef: MClassDef): MMethodDef
+ private fun build_contract(n_annotations: Array[AAnnotation], mcontract: MContract, mclassdef: MClassDef)
do
- self.current_location = n_annotation.location
+ var n_conditions = new Array[AExpr]
# Retrieving the expression provided in the annotation
- var n_condition = n_annotation.construct_condition(self)
- var m_contractdef: AMethPropdef
+ for n_annotation in n_annotations do n_conditions.add n_annotation.construct_condition(self)
if is_intro_contract then
# Create new contract method
- m_contractdef = mcontract.create_intro_contract(self, n_condition, mclassdef)
+ mcontract.create_intro_contract(self, n_conditions, mclassdef)
else
# Create a redef of contract to take in consideration the new condition
- m_contractdef = mcontract.create_subcontract(self, n_condition, mclassdef)
+ mcontract.create_subcontract(self, n_conditions, mclassdef)
end
- var contract_propdef = m_contractdef.mpropdef
- # The contract has a null mpropdef, this should never happen
- assert contract_propdef != null
- return contract_propdef
end
- # Verification if the construction of the contract is necessary.
- # Three cases are checked for `expects`:
- #
- # - Is the `--full-contract` option it's use?
- # - Is the method is in the main package
- # - Is the method is in a direct imported package.
- #
- fun check_usage_expects(actual_mmodule: MModule): Bool
+ # Inject the incontract attribute (`_in_contract_`) in the `Sys` class
+ # This attribute allows to check if the contract need to be executed
+ private fun inject_incontract_in_sys
do
- var main_package = mainmodule.mpackage
- var actual_package = actual_mmodule.mpackage
- if main_package != null and actual_package != null then
- var condition_direct_arc = toolcontext.modelbuilder.model.mpackage_importation_graph.has_arc(main_package, actual_package)
- return toolcontext.opt_full_contract.value or condition_direct_arc or main_package == actual_package
+ # If the `in_contract_attribute` already know just return
+ if in_contract_attribute != null then return
+
+ var sys_class = toolcontext.modelbuilder.get_mclass_by_name(visited_module, mainmodule, "Sys")
+
+ # Try to get the `in_contract` property, if it has already defined in a previously visited module.
+ var in_contract_property = toolcontext.modelbuilder.try_get_mproperty_by_name(visited_module, sys_class.intro, "__in_contract_")
+ if in_contract_property != null then
+ self.in_contract_attribute = in_contract_property.as(MAttribute)
+ return
end
- return false
+
+ var bool_false = new AFalseExpr.make(mainmodule.bool_type)
+ var n_in_contract_attribute = toolcontext.modelbuilder.create_attribute_from_name("__in_contract_", sys_class.intro, mainmodule.bool_type, public_visibility).create_setter(toolcontext.modelbuilder, true).define_default(bool_false)
+
+ in_contract_attribute = n_in_contract_attribute.mpropdef.mproperty
end
- # Verification if the construction of the contract is necessary.
- # Two cases are checked for `ensures`:
+ # Return the `_in_contract_` attribute.
+ # If the attribute `_in_contract_` does not exist it's injected with `inject_incontract_in_sys`
+ private fun get_incontract: MAttribute
+ do
+ if self.in_contract_attribute == null then inject_incontract_in_sys
+ return in_contract_attribute.as(not null)
+ end
+
+ # Return an `AIfExpr` with the contract encapsulated by an `if` to check if it's already in a contract verification.
+ #
+ # Example:
+ # ~~~nitish
+ # class A
+ # fun bar([...]) is except([...])
#
- # - Is the `--full-contract` option it's use?
- # - Is the method is in the main package
+ # fun _contract_bar([...])
+ # do
+ # if not sys._in_contract_ then
+ # sys._in_contract_ = true
+ # _bar_expect([...])
+ # sys._in_contract_ = false
+ # end
+ # bar([...])
+ # end
#
- fun check_usage_ensures(actual_mmodule: MModule): Bool
+ # fun _bar_expect([...])
+ # end
+ # ~~~~
+ #
+ private fun encapsulated_contract_call(visited_method: AMethPropdef, call_to_contracts: Array[ACallExpr]): AIfExpr
do
- return toolcontext.opt_full_contract.value or mainmodule.mpackage == actual_mmodule.mpackage
- end
+ var sys_property = toolcontext.modelbuilder.model.get_mproperties_by_name("sys").first.as(MMethod)
+ var callsite_sys = ast_builder.create_callsite(toolcontext.modelbuilder, visited_method, sys_property, true)
+ var incontract_attribute = get_incontract
+
+ var callsite_get_incontract = ast_builder.create_callsite(toolcontext.modelbuilder, visited_method, incontract_attribute.getter.as(MMethod), false)
+ var callsite_set_incontract = ast_builder.create_callsite(toolcontext.modelbuilder, visited_method, incontract_attribute.setter.as(MMethod), false)
+
+ var n_condition = ast_builder.make_not(ast_builder.make_call(ast_builder.make_call(new ASelfExpr, callsite_sys, null), callsite_get_incontract, null))
+
+ var n_if = ast_builder.make_if(n_condition, null)
+
+ var if_then_block = n_if.n_then.as(ABlockExpr)
+
+ if_then_block.add(ast_builder.make_call(ast_builder.make_call(new ASelfExpr, callsite_sys, null), callsite_set_incontract, [new ATrueExpr.make(mainmodule.bool_type)]))
+ if_then_block.add_all(call_to_contracts)
+ if_then_block.add(ast_builder.make_call(ast_builder.make_call(new ASelfExpr, callsite_sys, null), callsite_set_incontract, [new AFalseExpr.make(mainmodule.bool_type)]))
+
+ return n_if
+ end
end
# This visitor checks the `callsite` to see if the target `mpropdef` has a contract.
private class CallSiteVisitor
super Visitor
+ # Instance of the toolcontext
var toolcontext: ToolContext
+ var ast_builder: ASTBuilder
+
# Actual visited method
- var visited_method: APropdef is noinit
+ var visited_propdef: APropdef is noinit
redef fun visit(node)
do
node.visit_all(self)
end
- # Check if the callsite calls a method with a contract.
- # If it's the case the callsite is replaced by another callsite to the contract method.
- private fun drive_method_contract(callsite: CallSite): CallSite
+ # Check if the callsite is bound on a property with a contract.
+ # If the property is linked to a contract a new callsite will be created towards the correct facet,
+ # in the other case the returned callsite wall be the same as the given `callsite`
+ private fun drive_callsite_to_contract(callsite: CallSite): CallSite
do
- if callsite.mpropdef.has_contract then
- var contract_facet = callsite.mproperty.mcontract_facet
- var visited_mpropdef = visited_method.mpropdef
- assert contract_facet != null and visited_mpropdef != null
+ var contract_facet = callsite.mproperty.mcontract_facet
+ var visited_mpropdef = visited_propdef.mpropdef
- var unsafe_mtype = callsite.recv.resolve_for(visited_mpropdef.mclassdef.bound_mtype, callsite.anchor, visited_mpropdef.mclassdef.mmodule, true)
+ if visited_mpropdef isa MContract or visited_mpropdef isa MFacet then return callsite
+ if visited_mpropdef == null or contract_facet == null then return callsite
- # This check is needed because the contract can appear after the introduction.
- if unsafe_mtype.has_mproperty(visited_method.mpropdef.mclassdef.mmodule, contract_facet) then
- var type_visitor = new TypeVisitor(toolcontext.modelbuilder, visited_mpropdef)
- var drived_callsite = type_visitor.build_callsite_by_property(visited_method, callsite.recv, contract_facet, callsite.recv_is_self)
- # This never happen this check is here for debug
- assert drived_callsite != null
- return drived_callsite
- end
- end
- return callsite
+ return ast_builder.create_callsite(toolcontext.modelbuilder, visited_propdef, contract_facet, callsite.recv_is_self)
end
end
redef class AAnnotation
- # Returns the conditions of annotation parameters in the form of and expr
- # exemple:
- # the contract ensures(true, i == 10, f >= 1.0)
- # return this condition (true and i == 10 and f >= 1.0)
+ # Returns the conditions of annotation parameters. If there are several parameters, the result is an `AAndExpr`
+ # Example:
+ # the contract `ensure(true, i == 10, f >= 1.0)`
+ # return this condition `(true and i == 10 and f >= 1.0)`
private fun construct_condition(v : ContractsVisitor): AExpr
do
var n_condition = n_args.first
n_args.remove_at(0)
for n_arg in n_args do n_condition = v.ast_builder.make_and(n_condition, n_arg)
+ n_condition.location = self.location
return n_condition
end
end
-# The root of all contracts
-#
-# The objective of this class is to provide the set
-# of services must be implemented or provided by a contract
-abstract class MContract
- super MMethod
+redef class MContract
- # Define the name of the contract
- fun contract_name: String is abstract
+ # Should contract be called?
+ # return `true` if the contract needs to be called.
+ private fun is_called(v: ContractsVisitor, mpropdef: MPropDef): Bool
+ do
+ return v.toolcontext.opt_full_contract.value
+ end
# Method use to diplay warning when the contract is not present at the introduction
- private fun no_intro_contract(v: ContractsVisitor, a: AAnnotation)do end
+ private fun no_intro_contract(v: ContractsVisitor, a: Array[AAnnotation])do end
# Creating specific inheritance block contract
- private fun create_nblock(v: ContractsVisitor, n_condition: AExpr, args: Array[AExpr]): ABlockExpr is abstract
+ #
+ # `super_args` : Correspond to the `super` call arguments
+ private fun create_inherit_nblock(v: ContractsVisitor, n_conditions: Array[AExpr], super_args: Array[AExpr]): ABlockExpr is abstract
- # Method to adapt the `n_mpropdef.n_block` to the contract
- private fun adapt_block_to_contract(v: ContractsVisitor, n_mpropdef: AMethPropdef) is abstract
+ # Method to adapt the given `n_mpropdef.n_block` to the contract
+ private fun adapt_method_to_contract(v: ContractsVisitor, mfacet: MFacet, n_mpropdef: AMethPropdef) is abstract
- # Adapt the msignature specifically for the contract method
- private fun adapt_specific_msignature(m_signature: MSignature): MSignature do return m_signature.adapt_to_condition
+ # Create and return an adapted `MSignature` specifically for the contract in fonction of the given `m_signature`
+ private fun adapt_specific_msignature(m_signature: MSignature): MSignature do return m_signature.adapt_to_contract
- # Adapt the nsignature specifically for the contract method
- private fun adapt_specific_nsignature(n_signature: ASignature): ASignature do return n_signature.adapt_to_condition(null)
+ # Create and return an adapted `ASignature` specifically for the contract in fonction of the given `n_signature`
+ private fun adapt_specific_nsignature(n_signature: ASignature): ASignature do return n_signature.adapt_to_contract
# Adapt the `m_signature` to the contract
- # If it is not null call the specific adapt `m_signature` for the contract
+ # If `m_signature == null` return a new `MSignature` else it calls a specific adapt method see `adapt_specific_msignature`
private fun adapt_msignature(m_signature: nullable MSignature): MSignature
do
if m_signature == null then return new MSignature(new Array[MParameter])
end
# Adapt the `n_signature` to the contract
- # If it is not null call the specific adapt `n_signature` for the contract
+ # If `n_signature == null` return a new `ASignature` else it calls a specific adapt method see `adapt_specific_nsignature`
private fun adapt_nsignature(n_signature: nullable ASignature): ASignature
do
if n_signature == null then return new ASignature
return adapt_specific_nsignature(n_signature)
end
- # Create a new empty contract
- private fun create_empty_contract(v: ContractsVisitor, mclassdef: MClassDef, msignature: nullable MSignature, n_signature: ASignature)
- do
- var n_contract_def = intro_mclassdef.mclass.create_empty_method(v, self, mclassdef, msignature, n_signature)
- n_contract_def.do_all(v.toolcontext)
- end
-
# Create the initial contract (intro)
# All contracts have the same implementation for the introduction.
#
+ # Example:
+ # ~~~nitish
# fun contrat([...])
# do
# assert contract_condition
# end
+ # ~~~
#
- private fun create_intro_contract(v: ContractsVisitor, n_condition: nullable AExpr, mclassdef: MClassDef): AMethPropdef
+ private fun create_intro_contract(v: ContractsVisitor, n_conditions: Array[AExpr], mclassdef: MClassDef)
do
var n_block = v.ast_builder.make_block
- if n_condition != null then
+ for n_condition in n_conditions do
# Create a new tid to set the name of the assert for more explicit error
- var tid = new TId.init_tk(self.location)
- tid.text = "{self.contract_name}"
- n_block.add v.ast_builder.make_assert(tid, n_condition, null)
+ var tid = new TId.init_tk(n_condition.location)
+ tid.text = "{n_condition.location.text}"
+ var n_assert = v.ast_builder.make_assert(tid, n_condition, null)
+ # Define the assert location to reference the annoation
+ n_assert.location = n_condition.location
+ n_block.add n_assert
end
- return make_contract(v, n_block, mclassdef)
+ make_contract(v, n_block, mclassdef)
end
- # Create a contract with old (super) and the new conditions
- private fun create_subcontract(v: ContractsVisitor, ncondition: nullable AExpr, mclassdef: MClassDef): AMethPropdef
+ # Create a contract to check the old (super call) and the new conditions
+ #
+ # Example:
+ # ~~~nitish
+ # fun contrat([...])
+ # do
+ # super # Call the old contracts
+ # assert new_condition
+ # end
+ # ~~~
+ #
+ private fun create_subcontract(v: ContractsVisitor, n_conditions: Array[AExpr], mclassdef: MClassDef)
do
var args = v.n_signature.make_parameter_read(v.ast_builder)
var n_block = v.ast_builder.make_block
- if ncondition != null then n_block = self.create_nblock(v, ncondition, args)
- return make_contract(v, n_block, mclassdef)
+ n_block = self.create_inherit_nblock(v, n_conditions, args)
+ make_contract(v, n_block, mclassdef)
end
- # Build a method with a specific block `n_block` in a specified `mclassdef`
- private fun make_contract(v: ContractsVisitor, n_block: AExpr, mclassdef: MClassDef): AMethPropdef
+ # Build a new contract method with a specific block `n_block` in a specified `mclassdef`
+ private fun make_contract(v: ContractsVisitor, n_block: AExpr, mclassdef: MClassDef)
do
- var n_contractdef = intro_mclassdef.mclass.create_empty_method(v, self, mclassdef, v.m_signature, v.n_signature)
+ var n_contractdef = v.toolcontext.modelbuilder.create_method_from_property(self, mclassdef, false, v.m_signature)
+ # Set the signature to keep the same variable
+ n_contractdef.n_signature = v.n_signature
n_contractdef.n_block = n_block
# Define the location of the new method for corresponding of the annotation location
n_contractdef.location = v.current_location
n_contractdef.do_all(v.toolcontext)
- return n_contractdef
end
end
-# A expect (precondition) contract representation
-# This method check if the requirements of the called method is true.
-class MExpect
- super MContract
+redef class MExpect
- # Define the name of the contract
- redef fun contract_name: String do return "expects"
+ redef fun is_called(v: ContractsVisitor, mpropdef: MPropDef): Bool
+ do
+ var main_package = v.mainmodule.mpackage
+ var actual_package = mpropdef.mclassdef.mmodule.mpackage
+ if main_package != null and actual_package != null then
+ var condition_direct_arc = v.toolcontext.modelbuilder.model.mpackage_importation_graph.has_arc(main_package, actual_package)
+ return super or main_package == actual_package or condition_direct_arc
+ end
+ return false
+ end
# Display warning if no contract is defined at introduction `expect`,
# because if no contract is defined at the introduction the added
# contracts will not cause any error even if they are not satisfied.
#
- # exemple
+ # Example:
# ~~~nitish
# class A
# fun bar [...]
- # fun _bar_expects([...])
+ # fun _bar_expect([...])
# do
# [empty contract]
# end
# end
#
# redef class A
- # redef fun bar is expects(contract_condition)
- # redef fun _bar_expects([...])
+ # redef fun bar is expect(contract_condition)
+ # redef fun _bar_expect([...])
# do
- # if not (contract_condition) then super
+ # if (contract_condition) then return
+ # super
# end
# end
# ~~~~
#
- redef fun no_intro_contract(v: ContractsVisitor, a: AAnnotation)
+ redef fun no_intro_contract(v: ContractsVisitor, a: Array[AAnnotation])
do
- v.toolcontext.warning(a.location,"","Useless contract: No contract defined at the introduction of the method")
+ v.toolcontext.warning(a.first.location,"useless_contract","Useless contract: No contract defined at the introduction of the method")
end
- redef fun create_nblock(v: ContractsVisitor, n_condition: AExpr, args: Array[AExpr]): ABlockExpr
+ redef fun create_inherit_nblock(v: ContractsVisitor, n_conditions: Array[AExpr], super_args: Array[AExpr]): ABlockExpr
do
- # Creating the if expression with the new condition
- var if_block = v.ast_builder.make_if(n_condition, n_condition.mtype)
- # Creating and adding return expr to the then case
- if_block.n_then = v.ast_builder.make_return(null)
- # Creating the super call to the contract and adding this to else case
- if_block.n_else = v.ast_builder.make_super_call(args,null)
var n_block = v.ast_builder.make_block
- n_block.add if_block
+ for n_condition in n_conditions do
+ # Creating the if expression with the new condition
+ var if_block = v.ast_builder.make_if(n_condition, n_condition.mtype)
+ # Creating and adding return expr to the then case
+ if_block.n_then = v.ast_builder.make_return
+ if_block.location = n_condition.location
+ n_block.add if_block
+ end
+ n_block.add v.ast_builder.make_super_call(super_args)
return n_block
end
- redef fun adapt_block_to_contract(v: ContractsVisitor, n_mpropdef: AMethPropdef)
+ redef fun adapt_method_to_contract(v: ContractsVisitor, mfacet: MFacet, n_mpropdef: AMethPropdef)
do
var callsite = v.ast_builder.create_callsite(v.toolcontext.modelbuilder, n_mpropdef, self, true)
- var n_self = new ASelfExpr
var args = n_mpropdef.n_signature.make_parameter_read(v.ast_builder)
- var n_callexpect = v.ast_builder.make_call(n_self,callsite,args)
+ var n_callexpect = v.ast_builder.make_call(new ASelfExpr, callsite,args)
# Creation of the new instruction block with the call to expect condition
var actual_expr = n_mpropdef.n_block
var new_block = new ABlockExpr
- new_block.n_expr.push n_callexpect
+ new_block.n_expr.push v.encapsulated_contract_call(n_mpropdef, [n_callexpect])
if actual_expr isa ABlockExpr then
new_block.n_expr.add_all(actual_expr.n_expr)
else if actual_expr != null then
new_block.n_expr.push(actual_expr)
end
n_mpropdef.n_block = new_block
+ mfacet.has_applied_expect = true
end
end
-# The root of all contracts where the call is after the execution of the original method (`invariants` and `ensures`).
-abstract class BottomMContract
- super MContract
+redef class BottomMContract
- redef fun create_nblock(v: ContractsVisitor, n_condition: AExpr, args: Array[AExpr]): ABlockExpr
+ redef fun is_called(v: ContractsVisitor, mpropdef: MPropDef): Bool
+ do
+ return super or v.mainmodule.mpackage == mpropdef.mclassdef.mmodule.mpackage
+ end
+
+ redef fun create_inherit_nblock(v: ContractsVisitor, n_conditions: Array[AExpr], super_args: Array[AExpr]): ABlockExpr
do
- var tid = new TId.init_tk(v.current_location)
- tid.text = "{contract_name}"
- # Creating the assert expression with the new condition
- var assert_block = v.ast_builder.make_assert(tid,n_condition,null)
- # Creating the super call to the contract
- var super_call = v.ast_builder.make_super_call(args,null)
# Define contract block
var n_block = v.ast_builder.make_block
- # Adding the expressions to the block
+
+ var super_call = v.ast_builder.make_super_call(super_args)
+
n_block.add super_call
- n_block.add assert_block
+ for n_condition in n_conditions do
+ var tid = new TId.init_tk(n_condition.location)
+ tid.text = "{n_condition.location.text}"
+ # Creating the assert expression with the new condition
+ var n_assert = v.ast_builder.make_assert(tid, n_condition)
+ n_assert.location = n_condition.location
+ n_block.add n_assert
+ end
return n_block
end
- # Inject the result variable in the `n_block` of the given `n_mpropdef`.
+ # Inject the `result` variable into the `n_block` of the given n_mpropdef`.
+ #
+ # The purpose of the variable is to capture return values to use it in contracts.
private fun inject_result(v: ContractsVisitor, n_mpropdef: AMethPropdef, ret_type: MType): Variable
+ is
+ expect(n_mpropdef.n_signature.n_type != null)
do
var actual_block = n_mpropdef.n_block
# never happen. If it's the case the problem is in the contract facet building
assert actual_block isa ABlockExpr
- var return_var: nullable Variable = null
-
var return_expr = actual_block.n_expr.last.as(AReturnExpr)
var returned_expr = return_expr.n_expr
# The return node has no returned expression
assert returned_expr != null
- # Check if the result variable already exit
- if returned_expr isa AVarExpr then
- if returned_expr.variable.name == "result" then
- return_var = returned_expr.variable
- end
- end
-
- return_var = new Variable("result")
+ var return_var = new Variable("result")
# Creating a new variable to keep the old return of the method
var assign_result = v.ast_builder.make_var_assign(return_var, returned_expr)
# Remove the actual return
end
end
-# A ensure (postcondition) representation
-# This method check if the called method respects the expectations of the caller.
-class MEnsure
- super BottomMContract
-
- # Define the name of the contract
- redef fun contract_name: String do return "ensures"
+redef class MEnsure
redef fun adapt_specific_msignature(m_signature: MSignature): MSignature
do
return n_signature.adapt_to_ensurecondition
end
- redef fun adapt_block_to_contract(v: ContractsVisitor, n_mpropdef: AMethPropdef)
+ redef fun adapt_method_to_contract(v: ContractsVisitor, mfacet: MFacet, n_mpropdef: AMethPropdef)
do
var callsite = v.ast_builder.create_callsite(v.toolcontext.modelbuilder, n_mpropdef, self, true)
var n_self = new ASelfExpr
# argument to call the contract method
var args = n_mpropdef.n_signature.make_parameter_read(v.ast_builder)
- # Inject the variable result
- # The cast is always safe because the online adapted method is the contract facet
var actual_block = n_mpropdef.n_block
# never happen. If it's the case the problem is in the contract facet building
var ret_type = n_mpropdef.mpropdef.mproperty.intro.msignature.return_mtype
if ret_type != null then
+ # Inject the variable result
var result_var = inject_result(v, n_mpropdef, ret_type)
# Expr to read the result variable
var read_result = v.ast_builder.make_var_read(result_var, ret_type)
var return_expr = actual_block.n_expr.pop
# Adding the read return to argument
args.add(read_result)
- var n_callcontract = v.ast_builder.make_call(n_self,callsite,args)
- actual_block.add_all([n_callcontract,return_expr])
+ var n_call_contract = v.ast_builder.make_call(n_self, callsite, args)
+ actual_block.add_all([v.encapsulated_contract_call(n_mpropdef, [n_call_contract]), return_expr])
else
# build the call to the contract method
- var n_callcontract = v.ast_builder.make_call(n_self,callsite,args)
- actual_block.add n_callcontract
+ var n_call_contract = v.ast_builder.make_call(n_self, callsite, args)
+ actual_block.add v.encapsulated_contract_call(n_mpropdef, [n_call_contract])
end
- end
-end
-
-redef class MClass
-
- # This method create an abstract method representation with this MMethodDef an this AMethoddef
- private fun create_abstract_method(v: ContractsVisitor, mproperty: MMethod, mclassdef: MClassDef, msignature: nullable MSignature, n_signature: ASignature): AMethPropdef
- do
- # new methoddef definition
- var m_def = new MMethodDef(mclassdef, mproperty, v.current_location)
- # set the signature
- if msignature != null then m_def.msignature = msignature.clone
- # set the abstract flag
- m_def.is_abstract = true
- # Build the new node method
- var n_def = v.ast_builder.make_method(null,null,m_def,n_signature,null,null,null,null)
- # Define the location of the new method for corresponding of the actual method
- n_def.location = v.current_location
- # Association new npropdef to mpropdef
- v.toolcontext.modelbuilder.unsafe_add_mpropdef2npropdef(m_def,n_def)
- return n_def
- end
-
- # Create method with an empty block
- # the `mproperty` i.e the global property definition. The mclassdef to set where the method is declared and it's model `msignature` and ast `n_signature` signature
- private fun create_empty_method(v: ContractsVisitor, mproperty: MMethod, mclassdef: MClassDef, msignature: nullable MSignature, n_signature: ASignature): AMethPropdef
- do
- var n_def = create_abstract_method(v, mproperty, mclassdef, msignature, n_signature)
- n_def.mpropdef.is_abstract = false
- n_def.n_block = v.ast_builder.make_block
- return n_def
+ n_mpropdef.do_all(v.toolcontext)
+ mfacet.has_applied_ensure = true
end
end
redef class MMethod
- # The contract facet of the method
- # it's representing the method with contract
- # This method call the contract and the method
- var mcontract_facet: nullable MMethod = null
-
- # The expected contract method
- var mexpect: nullable MExpect = null
-
- # The ensure contract method
- var mensure: nullable MEnsure = null
-
- # Check if the MMethod has no ensure contract
- # if this is the case returns false and built it
- # else return true
- private fun check_exist_ensure: Bool
- do
- if self.mensure != null then return true
- # build a new `MEnsure` contract
- self.mensure = new MEnsure(intro_mclassdef, "_ensures_{name}", intro_mclassdef.location, public_visibility)
- return false
- end
-
- # Check if the MMethod has no expect contract
- # if this is the case returns false and built it
- # else return true
- private fun check_exist_expect: Bool
- do
- if self.mexpect != null then return true
- # build a new `MExpect` contract
- self.mexpect = new MExpect(intro_mclassdef, "_expects_{name}", intro_mclassdef.location, public_visibility)
- return false
- end
-
- # Check if the MMethod has an contract facet
- # If the method has no contract facet she create it
- private fun check_exist_contract_facet(mpropdef : MMethodDef): Bool
- do
- if self.mcontract_facet != null then return true
- # build a new `MMethod` contract
- self.mcontract_facet = new MMethod(mpropdef.mclassdef, "_contract_{name}", mpropdef.mclassdef.location, public_visibility)
- return false
- end
-end
-
-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, 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
+ # Define contract facet for MMethod in the given mclassdef. The facet represents the entry point with contracts (expect, ensure) of the method.
+ # If a contract is given adapt the contract facet.
+ #
+ # `classdef`: Indicates the class where we want to introduce our facet
+ # `exist_contract`: Indicates if it is necessary to define a new facet for the contract. If `exist_contract_facet and exist_contract` it's not necessary to add a facet.
+ #
+ # Exemple:
+ # ~~~nitish
+ # from:
+ # classe A
+ # i :Int
+ # fun add_one is ensure(old(i) + 1 == i)
+ # end
+ # to:
+ # classe A
+ # fun add_one is ensure(old(i) + 1 == i)
+ #
+ # # The contract facet
+ # fun contract_add_one do
+ # add_one
+ # ensure_add_one(old_add_one)
+ # end
+ # end
+ # ~~
+ private fun define_contract_facet(v: ContractsVisitor, classdef: MClassDef, mcontract: nullable MContract)
+ do
+ var exist_contract_facet = has_contract_facet
+ var contract_facet = build_contract_facet
+ # Do nothing the contract and the contract facet already exist
+ if mcontract != null and mcontract.is_already_applied(contract_facet) then return
+
+ var n_contract_facet: AMethPropdef
if not exist_contract_facet then
- # If has no contract facet just create it
- contract_facet = create_contract_facet(v, n_signature)
+ # If has no contract facet in intro just create it
+ if classdef != intro_mclassdef then
+ var n_intro_face = create_facet(v, intro_mclassdef, contract_facet, self)
+ n_intro_face.location = self.intro.location
+ n_intro_face.do_all(v.toolcontext)
+ end
+ n_contract_facet = create_facet(v, classdef, contract_facet, self)
else
- # Check if the contract facet already exist in this context (in this mclassdef)
- if mclassdef.mpropdefs_by_property.has_key(mproperty.mcontract_facet) then
- # get the define
- contract_facet = v.toolcontext.modelbuilder.mpropdef2node(mclassdef.mpropdefs_by_property[mproperty.mcontract_facet]).as(AMethPropdef)
+ # Check if the contract facet already exist in this context (in this classdef)
+ if classdef.mpropdefs_by_property.has_key(contract_facet) then
+ # get the definition
+ n_contract_facet = v.toolcontext.modelbuilder.mpropdef2node(classdef.mpropdefs_by_property[contract_facet]).as(AMethPropdef)
else
# create a new contract facet definition
- contract_facet = create_contract_facet(v, n_signature)
+ n_contract_facet = create_facet(v, classdef, contract_facet, self)
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)
+ var args = n_contract_facet.n_signature.make_parameter_read(v.ast_builder)
+ var n_super_call = v.ast_builder.make_super_call(args)
# verification for add a return or not
- if contract_facet.mpropdef.msignature.return_mtype != null then
+ if self.intro.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
+ n_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
+ if mcontract != null then mcontract.adapt_method_to_contract(v, contract_facet, n_contract_facet)
- # Method to create a contract facet of the method
- private fun create_contract_facet(v: ContractsVisitor, 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
+ n_contract_facet.location = v.current_location
+ n_contract_facet.do_all(v.toolcontext)
+ end
- var n_contractdef = mclassdef.mclass.create_empty_method(v, contract_facet, mclassdef, m_signature, n_signature)
+ # Method to create a facet of the method.
+ # See `define_contract_facet` for more information about two types of facets.
+ #
+ # `called` : is the property to call in this facet.
+ private fun create_facet(v: ContractsVisitor, classdef: MClassDef, facet: MFacet, called: MMethod): AMethPropdef
+ is
+ expect( called.is_same_instance(self) or called.is_same_instance(self.mcontract_facet) )
+ do
+ # Defines the contract facet is an init or not
+ # it is necessary to use the contracts with in a constructor
+ facet.is_init = is_init
+ var n_contractdef = v.toolcontext.modelbuilder.create_method_from_property(facet, classdef, false, self.intro.msignature)
# 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
+ # Arguments to call the `called` property
+ var args: Array[AExpr]
+ args = n_contractdef.n_signature.make_parameter_read(v.ast_builder)
+
+ var callsite = v.ast_builder.create_callsite(v.toolcontext.modelbuilder, n_contractdef, called, true)
+ var n_call = v.ast_builder.make_call(new ASelfExpr, callsite, args)
+
+ if self.intro.msignature.return_mtype == null then
block.add(n_call)
else
block.add(v.ast_builder.make_return(n_call))
n_contractdef.do_all(v.toolcontext)
return n_contractdef
end
+end
+
+redef class MMethodDef
# 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)
+ private fun construct_contract(v: ContractsVisitor, n_signature: ASignature, n_annotations: Array[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, mcontract, exist_contract)
- has_contract = true
+ if not exist_contract and not is_intro then no_intro_contract(v, mcontract, n_annotations)
+ v.build_contract(n_annotations, mcontract, mclassdef)
+ # Check if the contract must be called to know if it's needed to construct the facet
+ if mcontract.is_called(v, self) then mproperty.define_contract_facet(v, mclassdef, mcontract)
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)
+ private fun no_intro_contract(v: ContractsVisitor, mcontract: MContract, n_annotations: Array[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
+ v.toolcontext.modelbuilder.create_method_from_property(mcontract, mcontract.intro_mclassdef, false, v.m_signature)
+ mcontract.no_intro_contract(v, n_annotations)
end
- # Is the contract already defined in the context
- #
- # Exemple :
- # fun foo is expects([...]), expects([...])
- #
- # Here `check_same_contract` display an error when the second expects is processed
- private fun check_same_contract(v: ContractsVisitor, n_annotation: AAnnotation ,mcontract: MContract): Bool
+ # Apply the `no_contract` annotation to the contract. This method removes the inheritance by adding an empty contract method.
+ # Display a warning if the annotation is not needed
+ private fun no_contract_apply(v: ContractsVisitor, n_signature: ASignature)
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
+ var mensure = mproperty.mensure
+ var mexpect = mproperty.mexpect
+ if mensure == null and mexpect == null then
+ v.toolcontext.warning(location, "useless_nocontract", "Useless `no_contract`, no contract was declared for `{name}`. Remove the `no_contract`")
+ end
+ if mensure != null then
+ # Add an empty ensure method to replace the actual definition
+ v.toolcontext.modelbuilder.create_method_from_property(mensure, mclassdef, false, mensure.intro.msignature)
+ end
+ if mexpect != null then
+ # Add an empty expect method to replace the actual definition
+ v.toolcontext.modelbuilder.create_method_from_property(mexpect, mclassdef, false, mexpect.intro.msignature)
end
- return false
end
end
-redef class MPropDef
- # flag to indicate is the `MPropDef` has a contract
- var has_contract = false
-end
-
redef class APropdef
redef fun check_callsite(v)
do
- v.visited_method = self
+ v.visited_propdef = self
end
end
redef class AMethPropdef
- # Execute all method verification scope flow and typing.
- # It also execute an ast validation to define all parents and all locations
- private fun do_all(toolcontext: ToolContext)
- do
- self.validate
- # FIXME: The `do_` usage it is maybe to much (verification...). Solution: Cut the `do_` methods into simpler parts
- self.do_scope(toolcontext)
- self.do_flow(toolcontext)
- self.do_typing(toolcontext.modelbuilder)
- end
-
# Entry point to create a contract (verification of inheritance, or new contract).
redef fun create_contracts(v)
do
v.ast_builder.check_mmodule(mpropdef.mclassdef.mmodule)
-
v.current_location = self.location
v.is_intro_contract = mpropdef.is_intro
+ check_annotation(v)
+ if not mpropdef.is_intro then check_redef(v)
+ end
- if n_annotations != null then
- for n_annotation in n_annotations.n_items do
- check_annotation(v,n_annotation)
- end
+ # Verification of the annotation to know if it is a contract annotation.
+ # If this is the case, we built the appropriate contract.
+ private fun check_annotation(v: ContractsVisitor)
+ do
+ var annotations_expect = get_annotations("expect")
+ var annotations_ensure = get_annotations("ensure")
+ var annotation_no_contract = get_annotations("no_contract")
+
+ if (not annotations_expect.is_empty or not annotations_ensure.is_empty) and not annotation_no_contract.is_empty then
+ v.toolcontext.error(location, "The new contract definition is not correct when using `no_contract`. Remove the contract definition or the `no_contract`")
+ return
end
- if not mpropdef.is_intro and not v.find_no_contract then
- self.check_redef(v)
+ var nsignature = n_signature or else new ASignature
+
+ if not annotation_no_contract.is_empty then
+ mpropdef.no_contract_apply(v, nsignature.clone)
+ return
end
- # reset the flag
- v.find_no_contract = false
- end
+ if not annotations_expect.is_empty then
+ var exist_contract = mpropdef.mproperty.has_expect
+ mpropdef.construct_contract(v, nsignature.clone, annotations_expect, mpropdef.mproperty.build_expect, exist_contract)
+ end
- # Verification of the annotation to know if it is a contract annotation.
- # If this is the case, we built the appropriate contract.
- private fun check_annotation(v: ContractsVisitor, n_annotation: AAnnotation)
- do
- if n_annotation.name == "expects" then
- if not v.check_usage_expects(mpropdef.mclassdef.mmodule) then return
- var exist_contract = mpropdef.mproperty.check_exist_expect
- mpropdef.construct_contract(v, self.n_signature.as(not null), n_annotation, mpropdef.mproperty.mexpect.as(not null), exist_contract)
- else if n_annotation.name == "ensures" then
- if not v.check_usage_ensures(mpropdef.mclassdef.mmodule) then return
- var exist_contract = mpropdef.mproperty.check_exist_ensure
- mpropdef.construct_contract(v, self.n_signature.as(not null), n_annotation, mpropdef.mproperty.mensure.as(not null), exist_contract)
- else if n_annotation.name == "no_contract" then
- # no_contract found set the flag to true
- v.find_no_contract = true
+ if not annotations_ensure.is_empty then
+ var exist_contract = mpropdef.mproperty.has_ensure
+ mpropdef.construct_contract(v, nsignature.clone, annotations_ensure, mpropdef.mproperty.build_ensure, exist_contract)
end
end
# Verification if the method have an inherited contract to apply it.
private fun check_redef(v: ContractsVisitor)
do
- # Check if the method has an attached contract
- if not mpropdef.has_contract then
- if mpropdef.mproperty.intro.has_contract then
- mpropdef.has_contract = true
- end
- end
- end
+ var mexpect = mpropdef.mproperty.mexpect
+ var mensure = mpropdef.mproperty.mensure
+ var mcontract_facet = mpropdef.mproperty.mcontract_facet
- # Adapt the block to use the contracts
- private fun adapt_block_to_contract(v: ContractsVisitor, contract: MContract, n_mpropdef: AMethPropdef)
- do
- contract.adapt_block_to_contract(v, n_mpropdef)
- mpropdef.has_contract = true
- n_mpropdef.do_all(v.toolcontext)
+ if mexpect != null then
+ if mcontract_facet != null and mcontract_facet.has_applied_expect then return
+ if mexpect.is_called(v, mpropdef.as(not null)) then mpropdef.mproperty.define_contract_facet(v, mpropdef.mclassdef, mexpect)
+ end
+ if mensure != null then
+ if mcontract_facet != null and mcontract_facet.has_applied_ensure then return
+ if mensure.is_called(v, mpropdef.as(not null)) then mpropdef.mproperty.define_contract_facet(v, mpropdef.mclassdef, mensure)
+ end
end
end
redef class MSignature
- # Adapt signature for a expect condition
- # Removed the return type is it not necessary
- private fun adapt_to_condition: MSignature do return new MSignature(mparameters.to_a, null)
+ # Adapt signature for an contract
+ #
+ # The returned `MSignature` is the copy of `self` without return type.
+ private fun adapt_to_contract: MSignature do return new MSignature(mparameters.to_a, null)
- # Adapt signature for a ensure condition
+ # Adapt signature for a ensure contract
#
- # Create new parameter with the return type
+ # The returned `MSignature` is the copy of `self` without return type.
+ # The return type is replaced by a new parameter `result`
private fun adapt_to_ensurecondition: MSignature
do
var rtype = return_mtype
- var msignature = adapt_to_condition
+ var msignature = adapt_to_contract
if rtype != null then
msignature.mparameters.add(new MParameter("result", rtype, false))
end
return msignature
end
- # Adapt signature for a expect condition
- # Removed the return type is it not necessary
+ # The returned `MSignature` is the exact copy of `self`.
private fun clone: MSignature do return new MSignature(mparameters.to_a, return_mtype)
end
return args
end
- # Return a copy of self adapted for the expect condition
- # npropdef it is use to define the parent of the parameters
- private fun adapt_to_condition(return_type: nullable AType): ASignature
+ # Create a new ASignature adapted for contract
+ #
+ # The returned `ASignature` is the copy of `self` without return type.
+ private fun adapt_to_contract: ASignature
do
var adapt_nsignature = self.clone
- adapt_nsignature.n_type = return_type
+ if adapt_nsignature.n_type != null then adapt_nsignature.n_type.detach
return adapt_nsignature
end
- # Return a copy of self adapted for postcondition on npropdef
+ # Create a new ASignature adapted for ensure
+ #
+ # The returned `ASignature` is the copy of `self` without return type.
+ # The return type is replaced by a new parameter `result`
private fun adapt_to_ensurecondition: ASignature do
- var nsignature = adapt_to_condition(null)
+ var nsignature = adapt_to_contract
if ret_type != null then
- var n_id = new TId
- n_id.text = "result"
- var new_param = new AParam
- new_param.n_id = n_id
- new_param.variable = new Variable(n_id.text)
- new_param.variable.declared_type = ret_type
- nsignature.n_params.add new_param
+ var variable = new Variable("result")
+ variable.declared_type = ret_type
+ nsignature.n_params.add new AParam.make(variable, ret_type.create_ast_representation)
end
return nsignature
end
do
var actual_callsite = callsite
if actual_callsite != null then
- callsite = v.drive_method_contract(actual_callsite)
+ callsite = v.drive_callsite_to_contract(actual_callsite)
+ # Set the signature mapping with the old value, this avoids having to re-check the callsite.
+ callsite.signaturemap = actual_callsite.signaturemap
end
end
end
do
var actual_callsite = callsite
if actual_callsite != null then
- callsite = v.drive_method_contract(actual_callsite)
+ callsite = v.drive_callsite_to_contract(actual_callsite)
+ # Set the signature mapping with the old value, this avoids having to re-check the callsite
+ callsite.signaturemap = actual_callsite.signaturemap
end
end
end
var cmd = new CmdFeatures(test_model)
var res = cmd.http_init(req)
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 3
+ assert cmd.results.as(not null).length == 4
end
# CmdLinearization
var cmd = new CmdLinearization(test_model, test_main)
var res = cmd.http_init(req)
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 10
+ assert cmd.results.as(not null).length == 9
end
fun test_cmd_http_lin_no_lin is test do
var cmd = new CmdFeatures(test_model, mentity_name = "test_prog::Career")
var res = cmd.init_command
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 10
+ assert cmd.results.as(not null).length == 11
end
fun test_cmd_features_with_filter_attribute is test do
var cmd = new CmdFeatures(test_model, filter, mentity_name = "test_prog::Career")
var res = cmd.init_command
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 7
+ assert cmd.results.as(not null).length == 8
end
fun test_cmd_features_with_filter_public is test do
var cmd = new CmdFeatures(test_model, filter, mentity_name = "test_prog::Career")
var res = cmd.init_command
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 4
+ assert cmd.results.as(not null).length == 5
end
fun test_cmd_features_with_filter_match is test do
var cmd = new CmdFeatures(test_model, filter, mentity_name = "test_prog::TestGame")
var res = cmd.init_command
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 3
+ assert cmd.results.as(not null).length == 4
end
fun test_cmd_features_no_features is test do
var cmd = new CmdLinearization(test_model, test_main, mentity_name = "init")
var res = cmd.init_command
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 10
+ assert cmd.results.as(not null).length == 9
end
fun test_cmd_lin_no_lin is test do
var cmd = parser.parse("defs: test_prog::TestGame | inherited: TestGame")
assert cmd isa CmdFeatures
assert parser.error == null
- assert cmd.results.as(not null).length == 3
+ assert cmd.results.as(not null).length == 4
end
# CmdLinearization
redef class MMethodDef
redef fun html_signature(short) do
- var new_msignature = self.new_msignature
- if mproperty.is_root_init and new_msignature != null then
- return new_msignature.html_signature(short)
- end
var msignature = self.msignature
if msignature == null then return new Template
return msignature.html_signature(short)
redef class MMethodDef
redef fun cs_signature(no_color) do
- if mproperty.is_root_init then
- return new_msignature.as(not null).cs_signature(no_color)
- end
return msignature.as(not null).cs_signature(no_color)
end
end
-<ul><li><a href="test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dCharacter_36dtotal_strengh" title="The actual strength of the character.">total_strengh</a> - <span class="synopsis nitdoc">The actual strength of the character.</span></li></ul>
+<ul><li><a href="test_prog_36dCharacter_36ddefaultinit">defaultinit</a></li><li><a href="test_prog_36dCharacter_36dtotal_strengh" title="The actual strength of the character.">total_strengh</a> - <span class="synopsis nitdoc">The actual strength of the character.</span></li></ul>
-<ul><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_endurance_bonus">_endurance_bonus</a></li><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_intelligence_bonus">_intelligence_bonus</a></li><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_strength_bonus">_strength_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dendurance_bonus">endurance_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dendurance_bonus_61d">endurance_bonus=</a></li><li><a href="test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_58d_58dCareer_58d_58dintelligence_bonus">intelligence_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dintelligence_bonus_61d">intelligence_bonus=</a></li><li><a href="test_prog_58d_58dCareer_58d_58dstrength_bonus">strength_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dstrength_bonus_61d">strength_bonus=</a></li></ul>
+<ul><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_endurance_bonus">_endurance_bonus</a></li><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_intelligence_bonus">_intelligence_bonus</a></li><li><a href="test_prog_58d_58dcareers_58d_58dCareer_58d_58d_strength_bonus">_strength_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58ddefaultinit">defaultinit</a></li><li><a href="test_prog_58d_58dCareer_58d_58dendurance_bonus">endurance_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dendurance_bonus_61d">endurance_bonus=</a></li><li><a href="test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_58d_58dCareer_58d_58dintelligence_bonus">intelligence_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dintelligence_bonus_61d">intelligence_bonus=</a></li><li><a href="test_prog_58d_58dCareer_58d_58dstrength_bonus">strength_bonus</a></li><li><a href="test_prog_58d_58dCareer_58d_58dstrength_bonus_61d">strength_bonus=</a></li></ul>
-<ul><li><a href="test_prog_36dObject_36dinit">init</a></li><li><a href="test_prog_36dRace_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dHuman_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dElf_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dWarrior_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dMagician_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dAlcoholic_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dDwarf_36dObject_58d_58dinit">init</a></li></ul>
+<ul><li><a href="test_prog_36dObject_36dinit">init</a></li><li><a href="test_prog_36dRace_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dHuman_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dElf_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dWarrior_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dMagician_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dAlcoholic_36dObject_58d_58dinit">init</a></li><li><a href="test_prog_36dDwarf_36dObject_58d_58dinit">init</a></li></ul>
{
"results": [{
- "name": "init",
+ "name": "defaultinit",
"namespace": [{
"name": "test_prog",
"synopsis": "Test program for model tools."
"name": "Character",
"synopsis": "Characters can be played by both the human or the machine."
}, "$", {
- "name": "Object",
- "synopsis": "Root of everything."
- }, "::", {
- "name": "init"
+ "name": "defaultinit"
}],
"class_name": "MMethodDef",
- "full_name": "test_prog$Character$Object::init",
+ "full_name": "test_prog$Character$defaultinit",
"visibility": "public",
- "modifiers": ["redef", "init"],
+ "modifiers": ["init"],
+ "is_intro": true,
"msignature": {
- "arity": 0,
- "mparameters": [],
+ "arity": 4,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "race",
+ "mtype": {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "name",
+ "mtype": {
+ "name": "String",
+ "synopsis": "Strings (there is no chars...).",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Strings (there is no chars...).</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "age",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "sex",
+ "mtype": {
+ "name": "Bool",
+ "synopsis": "Booleans, `true` or `false`.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+ }
+ }],
"return_mtype": null
}
}, {
"html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
}
}, {
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Career",
+ "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Career::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+ }, {
"name": "endurance_bonus",
"namespace": [{
"name": "test_prog",
"name": "test_prog",
"synopsis": "Test program for model tools."
}, "$", {
- "name": "Character",
- "synopsis": "Characters can be played by both the human or the machine."
- }, "$", {
- "name": "Object",
- "synopsis": "Root of everything."
- }, "::", {
- "name": "init"
- }],
- "class_name": "MMethodDef",
- "full_name": "test_prog$Character$Object::init",
- "visibility": "public",
- "modifiers": ["redef", "init"],
- "msignature": {
- "arity": 0,
- "mparameters": [],
- "return_mtype": null
- }
- }, {
- "name": "init",
- "namespace": [{
- "name": "test_prog",
- "synopsis": "Test program for model tools."
- }, "$", {
"name": "Dwarf",
"synopsis": "Dwarves make strong warriors."
}, "$", {
}
}
{
- "name": "init",
+ "name": "defaultinit",
"namespace": [{
"name": "test_prog",
"synopsis": "Test program for model tools."
}, "$", {
- "name": "Character",
- "synopsis": "Characters can be played by both the human or the machine."
- }, "$", {
"name": "Object",
"synopsis": "Root of everything."
- }, "::", {
- "name": "init"
+ }, "$", {
+ "name": "defaultinit"
}],
"class_name": "MMethodDef",
- "full_name": "test_prog$Character$Object::init",
+ "full_name": "test_prog$Object$defaultinit",
"visibility": "public",
- "modifiers": ["redef", "init"],
+ "modifiers": ["init"],
+ "is_intro": true,
"msignature": {
"arity": 0,
"mparameters": [],
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Int",
+ "synopsis": "Some services about Integers."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Int$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "+",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Float",
+ "synopsis": "Some services about Floats."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Float$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Bool",
+ "synopsis": "Booleans, `true` or `false`."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Bool$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "String",
+ "synopsis": "Strings (there is no chars...)."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$String$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "List",
+ "synopsis": "List of things."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$List$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "main",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Sys",
+ "synopsis": "Sys"
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Sys$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "_strength_bonus",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Career",
+ "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Career$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Warrior",
+ "synopsis": "Warriors are good for fighting."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Warrior$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Magician",
+ "synopsis": "Magicians know magic and how to use it."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Magician$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Alcoholic",
+ "synopsis": "Alcoholics are good to nothing escept taking punches."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Alcoholic$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
"name": "_base_strength",
"synopsis": "Used to represents how strong the race is.",
"namespace": [{
}
}
{
- "name": "base_intelligence",
- "synopsis": "Is this race smart?",
+ "name": "base_intelligence",
+ "synopsis": "Is this race smart?",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ }, "$", {
+ "name": "base_intelligence",
+ "synopsis": "Is this race smart?"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Race$base_intelligence",
+ "visibility": "public",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
+ "modifiers": ["fun"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }
+}
+{
+ "name": "base_intelligence=",
+ "synopsis": "Is this race smart?",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ }, "$", {
+ "name": "base_intelligence=",
+ "synopsis": "Is this race smart?"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Race$base_intelligence=",
+ "visibility": "protected",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
+ "modifiers": ["protected", "fun"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 1,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Race$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Human",
+ "synopsis": "Humans are able to do everithing."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Human$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
"namespace": [{
"name": "test_prog",
"synopsis": "Test program for model tools."
}, "$", {
- "name": "Race",
- "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ "name": "Dwarf",
+ "synopsis": "Dwarves make strong warriors."
}, "$", {
- "name": "base_intelligence",
- "synopsis": "Is this race smart?"
+ "name": "defaultinit"
}],
"class_name": "MMethodDef",
- "full_name": "test_prog$Race$base_intelligence",
+ "full_name": "test_prog$Dwarf$defaultinit",
"visibility": "public",
- "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
- "modifiers": ["fun"],
+ "modifiers": ["init"],
"is_intro": true,
"msignature": {
- "arity": 0,
- "mparameters": [],
- "return_mtype": {
- "name": "Int",
- "synopsis": "Some services about Integers.",
- "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
- }
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
}
}
{
- "name": "base_intelligence=",
- "synopsis": "Is this race smart?",
+ "name": "defaultinit",
"namespace": [{
"name": "test_prog",
"synopsis": "Test program for model tools."
}, "$", {
- "name": "Race",
- "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ "name": "Elf",
+ "synopsis": "Elves make good magicians."
}, "$", {
- "name": "base_intelligence=",
- "synopsis": "Is this race smart?"
+ "name": "defaultinit"
}],
"class_name": "MMethodDef",
- "full_name": "test_prog$Race$base_intelligence=",
- "visibility": "protected",
- "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
- "modifiers": ["protected", "fun"],
+ "full_name": "test_prog$Elf$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
"is_intro": true,
"msignature": {
- "arity": 1,
+ "arity": 3,
"mparameters": [{
"is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
"name": "base_intelligence",
"mtype": {
"name": "Int",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Character",
+ "synopsis": "Characters can be played by both the human or the machine."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Character$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 4,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "race",
+ "mtype": {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "name",
+ "mtype": {
+ "name": "String",
+ "synopsis": "Strings (there is no chars...).",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Strings (there is no chars...).</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "age",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "sex",
+ "mtype": {
+ "name": "Bool",
+ "synopsis": "Booleans, `true` or `false`.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
"name": "dps",
"synopsis": "Damage per second inflicted by this weapon.",
"namespace": [{
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Weapon",
+ "synopsis": "Something that can be used to attack someone and inflict damage."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Weapon$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "hit_points",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Combatable",
+ "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Combatable$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "player_characters",
"synopsis": "Characters played by human players.",
"namespace": [{
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Game",
+ "synopsis": "This is the interface you have to implement to use ure gaming platform."
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Game$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "_player_characters",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "MyGame",
+ "synopsis": "This is an example of how to implement the Game interface"
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$MyGame$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "start",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "Starter"
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$Starter$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "_player_characters",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "TestGame"
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$TestGame$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "test_game",
"namespace": [{
"name": "test_prog",
"return_mtype": null
}
}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "$", {
+ "name": "GameTest"
+ }, "$", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethodDef",
+ "full_name": "test_prog$GameTest$defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_intro": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Object",
+ "synopsis": "Root of everything."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Object::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "unary -",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Int",
+ "synopsis": "Some services about Integers."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Int::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "+",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Float",
+ "synopsis": "Some services about Floats."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Float::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Bool",
+ "synopsis": "Booleans, `true` or `false`."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Bool::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "String",
+ "synopsis": "Strings (there is no chars...)."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::String::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "List",
+ "synopsis": "List of things."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::List::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "main",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Sys",
+ "synopsis": "Sys"
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Sys::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "_strength_bonus",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Career",
+ "synopsis": "A `Career` gives a characteristic bonus or malus to the character."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Career::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Warrior",
+ "synopsis": "Warriors are good for fighting."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Warrior::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Magician",
+ "synopsis": "Magicians know magic and how to use it."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Magician::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Alcoholic",
+ "synopsis": "Alcoholics are good to nothing escept taking punches."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Alcoholic::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "strength_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "endurance_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "intelligence_bonus",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
"name": "_base_strength",
"synopsis": "Used to represents how strong the race is.",
"namespace": [{
}
}
{
- "name": "base_intelligence",
- "synopsis": "Is this race smart?",
+ "name": "base_intelligence",
+ "synopsis": "Is this race smart?",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ }, "::", {
+ "name": "base_intelligence",
+ "synopsis": "Is this race smart?"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Race::base_intelligence",
+ "visibility": "public",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
+ "modifiers": ["fun"],
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }
+}
+{
+ "name": "base_intelligence=",
+ "synopsis": "Is this race smart?",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ }, "::", {
+ "name": "base_intelligence=",
+ "synopsis": "Is this race smart?"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Race::base_intelligence=",
+ "visibility": "protected",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
+ "modifiers": ["protected", "fun"],
+ "msignature": {
+ "arity": 1,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Race::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Human",
+ "synopsis": "Humans are able to do everithing."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Human::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
+ "name": "defaultinit",
"namespace": [{
"name": "test_prog",
"synopsis": "Test program for model tools."
}, "::", {
- "name": "Race",
- "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ "name": "Dwarf",
+ "synopsis": "Dwarves make strong warriors."
}, "::", {
- "name": "base_intelligence",
- "synopsis": "Is this race smart?"
+ "name": "defaultinit"
}],
"class_name": "MMethod",
- "full_name": "test_prog::Race::base_intelligence",
+ "full_name": "test_prog::Dwarf::defaultinit",
"visibility": "public",
- "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
- "modifiers": ["fun"],
+ "modifiers": ["init"],
+ "is_init": true,
"msignature": {
- "arity": 0,
- "mparameters": [],
- "return_mtype": {
- "name": "Int",
- "synopsis": "Some services about Integers.",
- "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
- }
+ "arity": 3,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_intelligence",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }],
+ "return_mtype": null
}
}
{
- "name": "base_intelligence=",
- "synopsis": "Is this race smart?",
+ "name": "defaultinit",
"namespace": [{
"name": "test_prog",
"synopsis": "Test program for model tools."
}, "::", {
- "name": "Race",
- "synopsis": "Race determines basic characteristics and what the character will be able to do in life."
+ "name": "Elf",
+ "synopsis": "Elves make good magicians."
}, "::", {
- "name": "base_intelligence=",
- "synopsis": "Is this race smart?"
+ "name": "defaultinit"
}],
"class_name": "MMethod",
- "full_name": "test_prog::Race::base_intelligence=",
- "visibility": "protected",
- "html_synopsis": "<span class=\"synopsis nitdoc\">Is this race smart?</span>",
- "modifiers": ["protected", "fun"],
+ "full_name": "test_prog::Elf::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
"msignature": {
- "arity": 1,
+ "arity": 3,
"mparameters": [{
"is_vararg": false,
+ "name": "base_strength",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "base_endurance",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
"name": "base_intelligence",
"mtype": {
"name": "Int",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Character",
+ "synopsis": "Characters can be played by both the human or the machine."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Character::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 4,
+ "mparameters": [{
+ "is_vararg": false,
+ "name": "race",
+ "mtype": {
+ "name": "Race",
+ "synopsis": "Race determines basic characteristics and what the character will be able to do in life.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Race determines basic characteristics and what the character will be able to do in life.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "name",
+ "mtype": {
+ "name": "String",
+ "synopsis": "Strings (there is no chars...).",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Strings (there is no chars...).</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "age",
+ "mtype": {
+ "name": "Int",
+ "synopsis": "Some services about Integers.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Some services about Integers.</span>"
+ }
+ }, {
+ "is_vararg": false,
+ "name": "sex",
+ "mtype": {
+ "name": "Bool",
+ "synopsis": "Booleans, `true` or `false`.",
+ "html_synopsis": "<span class=\"synopsis nitdoc\">Booleans, <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">true</span></span></span></code> or <code class=\"nitcode\"><span class=\"nitcode\"><span class=\"line\"><span class=\"nc_k\">false</span></span></span></code>.</span>"
+ }
+ }],
+ "return_mtype": null
+ }
+}
+{
"name": "dps",
"synopsis": "Damage per second inflicted by this weapon.",
"namespace": [{
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Weapon",
+ "synopsis": "Something that can be used to attack someone and inflict damage."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Weapon::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "hit_points",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Combatable",
+ "synopsis": "Something that can be combatted, it can `attack` and `defend`."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Combatable::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "player_characters",
"synopsis": "Characters played by human players.",
"namespace": [{
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Game",
+ "synopsis": "This is the interface you have to implement to use ure gaming platform."
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Game::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "_player_characters",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "MyGame",
+ "synopsis": "This is an example of how to implement the Game interface"
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::MyGame::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "start",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "Starter"
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::Starter::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "_player_characters",
"namespace": [{
"name": "test_prog",
}
}
{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "TestGame"
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::TestGame::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
+{
"name": "test_game",
"namespace": [{
"name": "test_prog",
"return_mtype": null
}
}
+{
+ "name": "defaultinit",
+ "namespace": [{
+ "name": "test_prog",
+ "synopsis": "Test program for model tools."
+ }, "::", {
+ "name": "GameTest"
+ }, "::", {
+ "name": "defaultinit"
+ }],
+ "class_name": "MMethod",
+ "full_name": "test_prog::GameTest::defaultinit",
+ "visibility": "public",
+ "modifiers": ["init"],
+ "is_init": true,
+ "msignature": {
+ "arity": 0,
+ "mparameters": [],
+ "return_mtype": null
+ }
+}
-* `character$Character$init`
+* `character$Character$defaultinit`
* `character$Character$total_strengh` - The actual strength of the character.
* `_endurance_bonus`
* `_intelligence_bonus`
* `_strength_bonus`
+* `defaultinit`
* `endurance_bonus`
* `endurance_bonus=`
* `careers$Career$init`
* `careers$Warrior$init`
* `careers$Magician$init`
* `careers$Alcoholic$init`
-* `character$Character$init`
* `races$Dwarf$init`
Methods calling `test_prog::Career::endurance_bonus`:
- * test_prog$Character$Object::init
- redef init init(race: Race, name: String, age: Int, sex: Bool)
+ + test_prog$Character$defaultinit
+ init defaultinit(race: Race, name: String, age: Int, sex: Bool)
test_location
+ test_prog$Character$total_endurance
test_location
* test_prog$Race$Object::init
- redef init init(base_strength: Int, base_endurance: Int, base_intelligence: Int)
+ redef init init
test_location
Catalog statistics:
* 2 packages
* 11 modules
- * 79 methods
+ * 101 methods
* 26 classes
* 509 lines of code
* 6 contributors
after_all
example
-expects
-ensures
+expect
+ensure
no_contract
"""
end
redef class AAttrPropdef
- private fun name: String do return n_id2.text
-
# Name of this attribute in the serialized format
private var serialize_name: String = name is lazy
end
# The main Sys instance
var mainobj: nullable Instance is noinit
+ # Name of all supported functional names
+ var routine_types: Set[String] = new HashSet[String]
+
init
do
if mainmodule.model.get_mclasses_by_name("Bool") != null then
init_instance_primitive(self.false_instance)
end
self.null_instance = new PrimitiveInstance[nullable Object](mainmodule.model.null_type, null)
+
+ routine_types.add("RoutineRef")
+ for name in ["Proc", "Fun", "ProcRef", "FunRef"] do
+ # 20 is a magic number = upper limit of the arity of each functional class.
+ # i.e. Proc0, Proc1, ... Proc19
+ for i in [0..20[ do
+ routine_types.add("{name}{i}")
+ end
+ end
end
# Starts the interpreter on the main module of a program
# Store known methods, used to trace methods as they are reached
var discover_call_trace: Set[MMethodDef] = new HashSet[MMethodDef]
+ # Consumes an iterator of expressions and tries to map each element to
+ # its corresponding Instance.
+ #
+ # If any AExprs doesn't resolve to an Instance, then it returns null.
+ # Otherwise return an array of instances
+ fun aexprs_to_instances(aexprs: Iterator[AExpr]): nullable Array[Instance]
+ do
+ var accumulator = new Array[Instance]
+ for aexpr in aexprs do
+ var instance = expr(aexpr)
+ if instance == null then return null
+ accumulator.push(instance)
+ end
+ return accumulator
+ end
+
# Evaluate `args` as expressions in the call of `mpropdef` on `recv`.
# This method is used to manage varargs in signatures and returns the real array
# of instances to use in the call.
# Return `null` if one of the evaluation of the arguments return null.
fun varargize(mpropdef: MMethodDef, map: nullable SignatureMap, recv: Instance, args: SequenceRead[AExpr]): nullable Array[Instance]
do
- var msignature = mpropdef.new_msignature or else mpropdef.msignature.as(not null)
+ var msignature = mpropdef.msignature.as(not null)
var res = new Array[Instance]
res.add(recv)
if map == null then
assert args.length == msignature.arity else debug("Expected {msignature.arity} args, got {args.length}")
- for ne in args do
- var e = self.expr(ne)
- if e == null then return null
- res.add e
- end
+ var rest_args = aexprs_to_instances(args.iterator)
+ if rest_args == null then return null
+ res.append(rest_args)
return res
end
# Eval in order of arguments, not parameters
- var exprs = new Array[Instance].with_capacity(args.length)
- for ne in args do
- var e = self.expr(ne)
- if e == null then return null
- exprs.add e
- end
+ var exprs = aexprs_to_instances(args.iterator)
+ if exprs == null then return null
# Fill `res` with the result of the evaluation according to the mapping
for i in [0..msignature.arity[ do
fun callsite(callsite: nullable CallSite, arguments: Array[Instance]): nullable Instance
do
if callsite == null then return null
- var initializers = callsite.mpropdef.initializers
- if not initializers.is_empty then
- var recv = arguments.first
- var i = 1
- for p in initializers do
- if p isa MMethod then
- var args = [recv]
- for x in p.intro.msignature.mparameters do
- args.add arguments[i]
- i += 1
- end
- self.send(p, args)
- else if p isa MAttribute then
- assert recv isa MutableInstance
- write_attribute(p, recv, arguments[i])
- i += 1
- else abort
- end
- assert i == arguments.length
-
- return send(callsite.mproperty, [recv])
- end
return send(callsite.mproperty, arguments)
end
var attributes: Map[MAttribute, Instance] = new HashMap[MAttribute, Instance]
end
+# An instance with the original receiver and callsite (for function reference)
+class CallrefInstance
+ super Instance
+
+ # The original receiver
+ #
+ # ~~~nitish
+ # var a = new A
+ # var f = &a.toto # `a` is the original receiver
+ # ~~~
+ var recv: Instance
+
+ # The original callsite
+ #
+ # ~~~nitish
+ # var a = new A
+ # var f = &a.toto # `toto` is the original callsite
+ # ~~~
+ var callsite: CallSite
+end
+
# Special instance to handle primitives values (int, bool, etc.)
# The trick is just to encapsulate the “real” value.
class PrimitiveInstance[E]
do
var pname = mpropdef.mproperty.name
var cname = mpropdef.mclassdef.mclass.name
+
+ if pname == "call" and v.routine_types.has(cname) then
+ var routine = args.shift
+ assert routine isa CallrefInstance
+ # Swap the receiver position with the original recv of the call form.
+ args.unshift routine.recv
+ var res = v.callsite(routine.callsite, args)
+ # recover the old args state
+ args.shift
+ args.unshift routine
+ return res
+ end
+
if pname == "output" then
var recv = args.first
recv.val.output
v.call(superpd, arguments)
end
return null
+ else if mclassdef.default_init == mpropdef then
+ var recv = arguments.first
+ var initializers = mpropdef.initializers
+ var no_init = false
+ if not initializers.is_empty and not mpropdef.is_old_style_init then
+ var i = 1
+ for p in initializers do
+ if p isa MMethod then
+ var args = [recv]
+ for x in p.intro.msignature.mparameters do
+ args.add arguments[i]
+ i += 1
+ end
+ v.send(p, args)
+ if p.intro.is_calling_init then no_init = true
+ else if p isa MAttribute then
+ assert recv isa MutableInstance
+ v.write_attribute(p, recv, arguments[i])
+ i += 1
+ else abort
+ end
+ assert i == arguments.length
+ end
+ if not no_init then v.send(mclass.the_root_init_mmethod.as(not null), [recv])
+ return null
else
abort
end
var args = v.varargize(callsite.mpropdef, callsite.signaturemap, recv, self.raw_arguments)
if args == null then return null
-
var res = v.callsite(callsite, args)
return res
end
end
redef class ACallrefExpr
- redef fun expr(v)
- do
- fatal(v, "NOT YET IMPLEMENTED callref expressions.")
- return null
- end
+ redef fun expr(v)
+ do
+ var recv = v.expr(self.n_expr)
+ if recv == null then return null
+ var mtype = self.mtype
+ assert mtype != null
+ # In case we are in generic class where formal parameter can not
+ # be resolved.
+ var mtype2 = v.unanchor_type(mtype)
+ var inst = new CallrefInstance(mtype2, recv, callsite.as(not null))
+ return inst
+ end
end
redef class ASendReassignFormExpr
super Visitor
var phase: AstMetricsPhase
- init(phase: AstMetricsPhase) do self.phase = phase
redef fun visit(n)
do
module mclassdef_collect
# We usualy need specific phases
-# NOTE: `frontend` is sufficent in most case (it is often too much)
+# NOTE: `frontend` is sufficent in most cases (it is often too much)
import frontend
import model_collect
module method_analyze_metrics
# We usualy need specific phases
-# NOTE: `frontend` is sufficent in most case (it is often too much)
+# NOTE: `frontend` is sufficent in most cases (it is often too much)
import nitsmell_toolcontext
import mclassdef_collect
var typecount: Counter[MType]
- # Get a new visitor on a classef to add type count in `typecount`.
- init(modelbuilder: ModelBuilder, nclassdef: AClassdef, typecount: Counter[MType])
- do
- self.modelbuilder = modelbuilder
- self.nclassdef = nclassdef
- self.typecount = typecount
- end
-
redef fun visit(n)
do
if n isa AAnnotation then return
# All property introductions and redefinitions in `self` (not inheritance).
var mpropdefs = new Array[MPropDef]
+ # The special default_init constructor
+ var default_init: nullable MMethodDef = null is writable
+
# All property introductions and redefinitions (not inheritance) in `self` by its associated property.
var mpropdefs_by_property = new HashMap[MProperty, MPropDef]
+ # Return the direct parent mtype of `self`
+ # Exemple
+ # ~~~nitish
+ # module 1
+ #
+ # class A
+ # class B
+ # super A
+ #
+ # module 2
+ #
+ # redef class A
+ # class C
+ # super B
+ #
+ # mclassdef_C.get_direct_supermtype == [B]
+ # ~~~~
+ fun get_direct_supermtype: Collection[MClassType]
+ do
+ # Get the potentiel direct parents
+ var parents = in_hierarchy.direct_greaters
+ # Stock the potentiel direct parents
+ var res = supertypes
+ for parent in parents do
+ # remove all super parents of the potentiel direct parents
+ res.remove_all(parent.supertypes)
+ # if the length of the potentiel direct parent equal 1 break
+ if res.length == 1 then break
+ end
+ return res
+ end
+
redef fun mdoc_or_fallback do return mdoc or else mclass.mdoc_or_fallback
end
# The signature attached to the property definition
var msignature: nullable MSignature = null is writable
- # The signature attached to the `new` call on a root-init
- # This is a concatenation of the signatures of the initializers
- #
- # REQUIRE `mproperty.is_root_init == (new_msignature != null)`
- var new_msignature: nullable MSignature = null is writable
-
# List of initialisers to call in root-inits
#
# They could be setters or attributes
- #
- # REQUIRE `mproperty.is_root_init == (new_msignature != null)`
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
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# The abstract concept of a contract in the model
+module model_contract
+
+import model
+import scope
+
+# The root of all contracts
+abstract class MContract
+ super MMethod
+
+ # Is the contract is it already applied on the given `mfacet`
+ fun is_already_applied(mfacet: MFacet): Bool is abstract
+end
+
+# An expect (precondition) contract representation
+class MExpect
+ super MContract
+
+ redef fun is_already_applied(mfacet: MFacet): Bool do return mfacet.has_applied_expect
+end
+
+# The root of all contracts where the call is after the execution of the original method (`invariant` and `ensure`).
+abstract class BottomMContract
+ super MContract
+end
+
+# A ensure (postcondition) representation
+class MEnsure
+ super BottomMContract
+
+ redef fun is_already_applied(mfacet: MFacet): Bool do return mfacet.has_applied_ensure
+end
+
+# A facet contract representation
+# This class is created to keep the information of which method is a contract facet
+class MFacet
+ super MMethod
+
+ # Is there an `expect` contract applied?
+ var has_applied_expect: Bool = false
+
+ # Is there an `ensure` contract applied?
+ var has_applied_ensure: Bool = false
+end
+
+redef class MMethod
+
+ # The contract facet of the method
+ # is representing the method with a contract
+ # This method calls contracts (expect, ensure) and the method
+ var mcontract_facet: nullable MFacet = null
+
+ # The `MExpect` contract if any
+ var mexpect: nullable MExpect = null
+
+ # The `MEnsure` contract if any
+ var mensure: nullable MEnsure = null
+
+ # Build `mensure` if is not exist and return it
+ private fun build_ensure: MEnsure
+ do
+ var m_mensure = self.mensure
+ # build a new `MEnsure` contract
+ if m_mensure == null then m_mensure = new MEnsure(intro_mclassdef, "_ensure_{name}", intro_mclassdef.location, public_visibility)
+ self.mensure = m_mensure
+ return m_mensure
+ end
+
+ # Is there an ensure contract?
+ fun has_ensure: Bool
+ do
+ return self.mensure != null
+ end
+
+ # Build `mexpect` if is not exist and return it
+ private fun build_expect: MExpect
+ do
+ var m_mexpect = self.mexpect
+ # build a new `MExpect` contract
+ if m_mexpect == null then m_mexpect = new MExpect(intro_mclassdef, "_expect_{name}", intro_mclassdef.location, public_visibility)
+ self.mexpect = m_mexpect
+ return m_mexpect
+ end
+
+ # Is there an expect contract?
+ fun has_expect: Bool
+ do
+ return self.mexpect != null
+ end
+
+ # Build `mcontract_facet` if is not exist and return it
+ private fun build_contract_facet: MFacet
+ do
+ var m_mcontract_facet = self.mcontract_facet
+ # build a new `MFacet` contract
+ if m_mcontract_facet == null then m_mcontract_facet = new MFacet(intro_mclassdef, "_contract_{name}", intro_mclassdef.location, public_visibility)
+ self.mcontract_facet = m_mcontract_facet
+ return m_mcontract_facet
+ end
+
+ # Is there an contract facet?
+ fun has_contract_facet: Bool
+ do
+ return self.mcontract_facet != null
+ end
+end
# If no such a class exists, then null is returned.
# If more than one class exists, then an error on `anode` is displayed and null is returned.
# FIXME: add a way to handle class name conflict
- fun try_get_mclass_by_name(anode: ANode, mmodule: MModule, name: String): nullable MClass
+ fun try_get_mclass_by_name(anode: nullable ANode, mmodule: MModule, name: String): nullable MClass
do
var classes = model.get_mclasses_by_name(name)
if classes == null then
end
# Like `try_get_mclass_by_name` but display an error message when the class is not found
- fun get_mclass_by_name(node: ANode, mmodule: MModule, name: String): nullable MClass
+ fun get_mclass_by_name(node: nullable ANode, mmodule: MModule, name: String): nullable MClass
do
var mclass = try_get_mclass_by_name(node, mmodule, name)
if mclass == null then
# If no such a property exists, then null is returned.
# If more than one property exists, then an error on `anode` is displayed and null is returned.
# FIXME: add a way to handle property name conflict
- fun try_get_mproperty_by_name2(anode: ANode, mmodule: MModule, mtype: MType, name: String): nullable MProperty
+ fun try_get_mproperty_by_name2(anode: nullable ANode, mmodule: MModule, mtype: MType, name: String): nullable MProperty
do
var props = self.model.get_mproperties_by_name(name)
if props == null then
# Alias for try_get_mproperty_by_name2(anode, mclassdef.mmodule, mclassdef.mtype, name)
- fun try_get_mproperty_by_name(anode: ANode, mclassdef: MClassDef, name: String): nullable MProperty
+ fun try_get_mproperty_by_name(anode: nullable ANode, mclassdef: MClassDef, name: String): nullable MProperty
do
return try_get_mproperty_by_name2(anode, mclassdef.mmodule, mclassdef.bound_mtype, name)
end
mpropdef2npropdef[mpropdef] = npropdef
end
+ # Associate a `nclassdef` with its `mclassdef`
+ #
+ # Be careful, this method is unsafe, no checking is done when it's used.
+ # The safe way to add mclass it's to use the `build_property`
+ #
+ # See `mclassdef2nclassdef`
+ fun unsafe_add_mclassdef2nclassdef(mclassdef: MClassDef, nclassdef: AClassdef)
+ do
+ mclassdef2nclassdef[mclassdef] = nclassdef
+ end
+
# Retrieve the associated AST node of a mpropertydef.
# This method is used to associate model entity with syntactic entities.
#
toolcontext.run_phases_on_npropdef(res)
return res
end
- if mpropdef isa MMethodDef and mpropdef.mproperty.is_root_init then
- res = mclassdef2nclassdef.get_or_null(mpropdef.mclassdef)
- if res != null then return res
- end
+ # Fall back to the class node if any.
+ res = mclassdef2nclassdef.get_or_null(mpropdef.mclassdef)
+ if res != null then return res
return null
end
var mclassdef = nclassdef.mclassdef.as(not null)
# Are we a refinement
- if not mclassdef.is_intro then return
+ if not mclassdef.is_intro then
+ # Set the default_init of the mclassdef with the intro default_init
+ mclassdef.default_init = mclassdef.mclass.intro.default_init
+ return
+ end
# Look for the init in Object, or create it
if mclassdef.mclass.name == "Object" and the_root_init_mmethod == null then
var mparameters = new Array[MParameter]
var msignature = new MSignature(mparameters, null)
mpropdef.msignature = msignature
- mpropdef.new_msignature = msignature
mprop.is_init = true
self.toolcontext.info("{mclassdef} gets a free empty constructor {mpropdef}{msignature}", 3)
the_root_init_mmethod = mprop
- return
end
# Is there already a constructor defined?
if mpropdef.mproperty.is_root_init then
assert defined_init == null
defined_init = mpropdef
- else if mpropdef.mproperty.name == "init" then
- # An explicit old-style init named "init", so return
+ else if mpropdef.name == "defaultinit" then
return
end
end
- if not nclassdef isa AStdClassdef then return
+ if mclassdef.default_init != null then return
+
+ # If the class is not AStdClassdef or it's an enum just return. No defaultinit is need.
+ if not nclassdef isa AStdClassdef or nclassdef.n_classkind isa AEnumClasskind then return
# Collect undefined attributes
var mparameters = new Array[MParameter]
if mpropdef == null then return # Skip broken method
var sig = mpropdef.msignature
if sig == null then continue # Skip broken method
-
mparameters.add_all sig.mparameters
initializers.add(mpropdef.mproperty)
mpropdef.mproperty.is_autoinit = true
if the_root_init_mmethod == null then return
# Look for most-specific new-stype init definitions
- var spropdefs = the_root_init_mmethod.lookup_super_definitions(mclassdef.mmodule, mclassdef.bound_mtype)
- if spropdefs.is_empty then
- toolcontext.error(nclassdef.location, "Error: `{mclassdef}` does not specialize `{the_root_init_mmethod.intro_mclassdef}`. Possible duplication of the root class `Object`?")
- return
+ var spropdefs = new ArraySet[MMethodDef]
+
+ for x in mclassdef.get_direct_supermtype do
+ var y = x.mclass.intro.default_init
+ if y == null then continue
+ if y.is_broken or y.msignature == null then return
+ spropdefs.add y
end
# Look at the autoinit class-annotation
abort
end
end
- else
+ else if spropdefs.not_empty then
+ # Search for inherited manual defaultinit
+ var manual = null
+ for s in spropdefs do
+ if mpropdef2npropdef.has_key(s) then
+ self.toolcontext.info("{mclassdef} inherits a manual defaultinit {s}", 3)
+ manual = s
+ end
+ end
# Search the longest-one and checks for conflict
var longest = spropdefs.first
if spropdefs.length > 1 then
# part 1. find the longest list
for spd in spropdefs do
if spd.initializers.length > longest.initializers.length then longest = spd
+
+ if spd != manual and manual != null then
+ self.toolcontext.info("{mclassdef} conflict between manual defaultinit {manual} and automatic defaultinit {spd}.", 3)
+ end
+ end
+ # conflict with manual autoinit?
+ if longest != manual and manual != null then
+ self.error(nclassdef, "Error: conflict between manual defaultinit {manual} and automatic defaultinit {longest}.")
end
# part 2. compare
# Check for conflict in the order of initializers
mparameters.clear
initializers.clear
else
- # Can we just inherit?
- if spropdefs.length == 1 and mparameters.is_empty and defined_init == null then
- self.toolcontext.info("{mclassdef} inherits the basic constructor {longest}", 3)
- mclassdef.mclass.root_init = longest
- return
- end
-
# Combine the inherited list to what is collected
if longest.initializers.length > 0 then
- mparameters.prepend longest.new_msignature.mparameters
+ mparameters.prepend longest.msignature.mparameters
initializers.prepend longest.initializers
end
end
end
- # If we already have a basic init definition, then setup its initializers
- if defined_init != null then
- defined_init.initializers.add_all(initializers)
+ # Create a specific new autoinit constructor
+ do
+ var mprop = new MMethod(mclassdef, "defaultinit", nclassdef.location, public_visibility)
+ mprop.is_init = true
+ var mpropdef = new MMethodDef(mclassdef, mprop, nclassdef.location)
+ mpropdef.initializers.add_all(initializers)
var msignature = new MSignature(mparameters, null)
- defined_init.new_msignature = msignature
- self.toolcontext.info("{mclassdef} extends its basic constructor signature to {defined_init}{msignature}", 3)
- mclassdef.mclass.root_init = defined_init
- return
+ mpropdef.msignature = msignature
+ mclassdef.default_init = mpropdef
+ self.toolcontext.info("{mclassdef} gets a free auto constructor `{mpropdef}{msignature}`. {spropdefs}", 3)
+ mclassdef.mclass.the_root_init_mmethod = the_root_init_mmethod
end
-
- # Else create the local implicit basic init definition
- var mprop = the_root_init_mmethod
- var mpropdef = new MMethodDef(mclassdef, mprop, nclassdef.location)
- mpropdef.has_supercall = true
- mpropdef.initializers.add_all(initializers)
- var msignature = new MSignature(mparameters, null)
- mpropdef.new_msignature = msignature
- mpropdef.msignature = new MSignature(new Array[MParameter], null) # always an empty real signature
- self.toolcontext.info("{mclassdef} gets a free constructor for attributes {mpropdef}{msignature}", 3)
- mclassdef.mclass.root_init = mpropdef
end
# Check the visibility of `mtype` as an element of the signature of `mpropdef`.
redef class MClass
# The base init of the class.
- # Used to get the common new_msignature and initializers
#
- # TODO: Where to put this information is not clear because unlike other
- # informations, the initialisers are stable in a same class.
- var root_init: nullable MMethodDef = null
+ # TODO: merge with `root_init` and `ModelBuilder::the_root_init_mmethod` if possible
+ var the_root_init_mmethod: nullable MMethod = null
end
redef class MClassDef
var name: String
var amethodid = self.n_methid
var name_node: ANode
+ var is_old_style_init = false
if amethodid == null then
if n_kwinit != null then
name = "init"
name_node = n_kwinit
+ var old_style_annot = get_single_annotation("old_style_init", modelbuilder)
+ if old_style_annot != null or self.n_signature.n_params.not_empty then
+ name = "defaultinit"
+ if old_style_annot != null then is_old_style_init = true
+ end
else if n_kwnew != null then
name = "new"
name_node = n_kwnew
var look_like_a_root_init = look_like_a_root_init(modelbuilder, mclassdef)
var mprop: nullable MMethod = null
- if not is_init or n_kwredef != null then mprop = modelbuilder.try_get_mproperty_by_name(name_node, mclassdef, name).as(nullable MMethod)
+ if not is_init or n_kwredef != null or look_like_a_root_init then mprop = modelbuilder.try_get_mproperty_by_name(name_node, mclassdef, name).as(nullable MMethod)
if mprop == null and look_like_a_root_init then
mprop = modelbuilder.the_root_init_mmethod
var nb = n_block
mclassdef.mprop2npropdef[mprop] = self
var mpropdef = new MMethodDef(mclassdef, mprop, self.location)
+ if mpropdef.name == "defaultinit" and mclassdef.is_intro then
+ assert mclassdef.default_init == null
+ mpropdef.is_old_style_init = is_old_style_init
+ mclassdef.default_init = mpropdef
+ # Set the initializers with the mproperty.
+ # This point is need when a super class define this own default_init and inherited class use the default_init generated automaticlely.
+ mpropdef.initializers.add mprop
+ mpropdef.is_calling_init = true
+ end
set_doc(mpropdef, modelbuilder)
var mmodule = mclassdef.mmodule
var nsig = self.n_signature
- if mproperty.is_root_init and not mclassdef.is_intro then
- var root_init = mclassdef.mclass.root_init
- if root_init != null then
- # Inherit the initializers by refinement
- mpropdef.new_msignature = root_init.new_msignature
- assert mpropdef.initializers.is_empty
- mpropdef.initializers.add_all root_init.initializers
- end
- end
-
var accept_special_last_parameter = self.n_methid == null or self.n_methid.accept_special_last_parameter
var return_is_mandatory = self.n_methid != null and self.n_methid.return_is_mandatory
# Could be through `n_expr`, `n_block` or `is_lazy`
var has_value = false
+ # The name of the attribute
+ # Note: The name of the attribute is in reality the name of the mreadpropdef
+ var name: String = n_id2.text is lazy
+
# The guard associated to a lazy attribute.
# Because some engines does not have a working `isset`,
# this additional attribute is used to guard the lazy initialization.
redef fun build_property(modelbuilder, mclassdef)
do
var mclass = mclassdef.mclass
- var nid2 = n_id2
- var name = nid2.text
var atabstract = self.get_single_annotation("abstract", modelbuilder)
- if atabstract == null then
- if not mclass.kind.need_init then
- modelbuilder.error(self, "Error: attempt to define attribute `{name}` in the {mclass.kind} `{mclass}`.")
- end
- var mprop = new MAttribute(mclassdef, "_" + name, self.location, private_visibility)
- var mpropdef = new MAttributeDef(mclassdef, mprop, self.location)
- self.mpropdef = mpropdef
- modelbuilder.mpropdef2npropdef[mpropdef] = self
- end
-
- var readname = name
- var mreadprop = modelbuilder.try_get_mproperty_by_name(nid2, mclassdef, readname).as(nullable MMethod)
- if mreadprop == null then
- var mvisibility = new_property_visibility(modelbuilder, mclassdef, self.n_visibility)
- mreadprop = new MMethod(mclassdef, readname, self.location, mvisibility)
- if not self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, false, mreadprop) then
- mreadprop.is_broken = true
- return
- end
- else
- if mreadprop.is_broken then return
- if not self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, true, mreadprop) then return
- check_redef_property_visibility(modelbuilder, self.n_visibility, mreadprop)
- end
- mclassdef.mprop2npropdef[mreadprop] = self
+ if atabstract == null then build_attribute_property(modelbuilder, mclassdef)
- var attr_mpropdef = mpropdef
- if attr_mpropdef != null then
- mreadprop.getter_for = attr_mpropdef.mproperty
- attr_mpropdef.mproperty.getter = mreadprop
- end
+ # Construction of the read property. If it's not correctly built just return.
+ if not build_read_property(modelbuilder, mclassdef) then return
- var mreadpropdef = new MMethodDef(mclassdef, mreadprop, self.location)
- self.mreadpropdef = mreadpropdef
- modelbuilder.mpropdef2npropdef[mreadpropdef] = self
- set_doc(mreadpropdef, modelbuilder)
- if mpropdef != null then mpropdef.mdoc = mreadpropdef.mdoc
if atabstract != null then mreadpropdef.is_abstract = true
has_value = n_expr != null or n_block != null
end
end
- var atlazy = self.get_single_annotation("lazy", modelbuilder)
- var atlateinit = self.get_single_annotation("lateinit", modelbuilder)
- if atlazy != null or atlateinit != null then
- if atlazy != null and atlateinit != null then
- modelbuilder.error(atlazy, "Error: `lazy` incompatible with `lateinit`.")
- return
- end
- if not has_value then
- if atlazy != null then
- modelbuilder.error(atlazy, "Error: `lazy` attributes need a value.")
- else if atlateinit != null then
- modelbuilder.error(atlateinit, "Error: `lateinit` attributes need a value.")
- end
- has_value = true
- return
- end
- is_lazy = true
- var mlazyprop = new MAttribute(mclassdef, "lazy _" + name, self.location, none_visibility)
- mlazyprop.is_fictive = true
- var mlazypropdef = new MAttributeDef(mclassdef, mlazyprop, self.location)
- mlazypropdef.is_fictive = true
- self.mlazypropdef = mlazypropdef
- end
+ # Construction of the read property. If it's not correctly built just return.
+ if not build_lazy_property(modelbuilder, mclassdef) then return
var atoptional = self.get_single_annotation("optional", modelbuilder)
if atoptional != null then
modelbuilder.advice(self, "attr-in-refinement", "Warning: attributes in refinement need a value or `noautoinit`.")
end
+ # Construction of the read property. If it's not correctly built just return.
+ if not build_write_property(modelbuilder, mclassdef, false) then return
+
+ if atabstract != null then mwritepropdef.is_abstract = true
+
+ var atautoinit = self.get_single_annotation("autoinit", modelbuilder)
+ if atautoinit != null then
+ if has_value then
+ modelbuilder.error(atautoinit, "Error: `autoinit` attributes cannot have an initial value.")
+ else if not mwritepropdef.is_intro then
+ modelbuilder.error(atautoinit, "Error: `autoinit` attributes cannot be set on redefinitions.")
+ else if not mclassdef.is_intro then
+ modelbuilder.error(atautoinit, "Error: `autoinit` attributes cannot be used in class refinements.")
+ else if atabstract == null then
+ modelbuilder.warning(atautoinit, "useless-autoinit", "Warning: superfluous `autoinit` on attribute.")
+ end
+ else if atabstract != null then
+ # By default, abstract attribute are not autoinit
+ noinit = true
+ end
+ end
+
+ # Build the attribute property
+ fun build_attribute_property(modelbuilder: ModelBuilder, mclassdef: MClassDef)
+ do
+ var mclass = mclassdef.mclass
+ var attribute_name = "_" + name
+
+ if not mclass.kind.need_init then
+ modelbuilder.error(self, "Error: attempt to define attribute `{name}` in the {mclass.kind} `{mclass}`.")
+ end
+ var mprop = new MAttribute(mclassdef, "_" + name, self.location, private_visibility)
+ var mpropdef = new MAttributeDef(mclassdef, mprop, self.location)
+ self.mpropdef = mpropdef
+ modelbuilder.mpropdef2npropdef[mpropdef] = self
+ end
+
+ # Build the read method property to get the value of the attribute
+ # Return `true` if the property was correctly created else return `false`.
+ # Warning the signature of the property is not set. This step is done by `build_signature`.
+ fun build_read_property(modelbuilder: ModelBuilder, mclassdef: MClassDef): Bool
+ do
+ var mclass = mclassdef.mclass
+
+ var readname = name
+ var mreadprop = modelbuilder.try_get_mproperty_by_name(self, mclassdef, readname).as(nullable MMethod)
+ if mreadprop == null then
+ var mvisibility = new_property_visibility(modelbuilder, mclassdef, self.n_visibility)
+ mreadprop = new MMethod(mclassdef, readname, self.location, mvisibility)
+ if not self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, false, mreadprop) then
+ mreadprop.is_broken = true
+ return false
+ end
+ else
+ if mreadprop.is_broken then return false
+ if not self.check_redef_keyword(modelbuilder, mclassdef, n_kwredef, true, mreadprop) then return false
+ check_redef_property_visibility(modelbuilder, self.n_visibility, mreadprop)
+ end
+ mclassdef.mprop2npropdef[mreadprop] = self
+
+ var attr_mpropdef = mpropdef
+ if attr_mpropdef != null then
+ mreadprop.getter_for = attr_mpropdef.mproperty
+ attr_mpropdef.mproperty.getter = mreadprop
+ end
+
+ var mreadpropdef = new MMethodDef(mclassdef, mreadprop, self.location)
+ self.mreadpropdef = mreadpropdef
+ modelbuilder.mpropdef2npropdef[mreadpropdef] = self
+ set_doc(mreadpropdef, modelbuilder)
+ if mpropdef != null then mpropdef.mdoc = mreadpropdef.mdoc
+
+ return true
+ end
+
+ # Build the write method property to set the attribute value
+ # Return `true` if the property was correctly created else return `false`.
+ # Warning the signature of the property is not set.
+ fun build_write_property(modelbuilder: ModelBuilder, mclassdef: MClassDef, is_same_visibility: Bool): Bool
+ do
+ var mclass = mclassdef.mclass
+
var writename = name + "="
var atwritable = self.get_single_annotation("writable", modelbuilder)
if atwritable != null then
writename = atwritable.arg_as_id(modelbuilder) or else writename
end
end
- var mwriteprop = modelbuilder.try_get_mproperty_by_name(nid2, mclassdef, writename).as(nullable MMethod)
+ var mwriteprop = modelbuilder.try_get_mproperty_by_name(self, mclassdef, writename).as(nullable MMethod)
var nwkwredef: nullable Token = null
if atwritable != null then nwkwredef = atwritable.n_kwredef
if mwriteprop == null then
if atwritable != null then
mvisibility = new_property_visibility(modelbuilder, mclassdef, atwritable.n_visibility)
else
- mvisibility = mreadprop.visibility
+ mvisibility = mreadpropdef.mproperty.visibility
# By default, use protected visibility at most
- if mvisibility > protected_visibility then mvisibility = protected_visibility
+ if mvisibility > protected_visibility and not is_same_visibility then mvisibility = protected_visibility
end
mwriteprop = new MMethod(mclassdef, writename, self.location, mvisibility)
if not self.check_redef_keyword(modelbuilder, mclassdef, nwkwredef, false, mwriteprop) then
mwriteprop.is_broken = true
- return
+ return false
end
- mwriteprop.deprecation = mreadprop.deprecation
+ mwriteprop.deprecation = mreadpropdef.mproperty.deprecation
else
- if mwriteprop.is_broken then return
- if not self.check_redef_keyword(modelbuilder, mclassdef, nwkwredef or else n_kwredef, true, mwriteprop) then return
+ if mwriteprop.is_broken then return false
+ if not self.check_redef_keyword(modelbuilder, mclassdef, nwkwredef or else n_kwredef, true, mwriteprop) then return false
if atwritable != null then
check_redef_property_visibility(modelbuilder, atwritable.n_visibility, mwriteprop)
end
end
mclassdef.mprop2npropdef[mwriteprop] = self
+ var attr_mpropdef = mpropdef
if attr_mpropdef != null then
mwriteprop.setter_for = attr_mpropdef.mproperty
attr_mpropdef.mproperty.setter = mwriteprop
self.mwritepropdef = mwritepropdef
modelbuilder.mpropdef2npropdef[mwritepropdef] = self
mwritepropdef.mdoc = mreadpropdef.mdoc
- if atabstract != null then mwritepropdef.is_abstract = true
- var atautoinit = self.get_single_annotation("autoinit", modelbuilder)
- if atautoinit != null then
- if has_value then
- modelbuilder.error(atautoinit, "Error: `autoinit` attributes cannot have an initial value.")
- else if not mwritepropdef.is_intro then
- modelbuilder.error(atautoinit, "Error: `autoinit` attributes cannot be set on redefinitions.")
- else if not mclassdef.is_intro then
- modelbuilder.error(atautoinit, "Error: `autoinit` attributes cannot be used in class refinements.")
- else if atabstract == null then
- modelbuilder.warning(atautoinit, "useless-autoinit", "Warning: superfluous `autoinit` on attribute.")
+ return true
+ end
+
+ # Build the lazy attribute property
+ # Return `true` if the property was correctly created else return `false`.
+ fun build_lazy_property(modelbuilder: ModelBuilder, mclassdef: MClassDef): Bool
+ do
+ var mclass = mclassdef.mclass
+
+ var atlazy = self.get_single_annotation("lazy", modelbuilder)
+ var atlateinit = self.get_single_annotation("lateinit", modelbuilder)
+ if atlazy != null or atlateinit != null then
+ if atlazy != null and atlateinit != null then
+ modelbuilder.error(atlazy, "Error: `lazy` incompatible with `lateinit`.")
+ return false
end
- else if atabstract != null then
- # By default, abstract attribute are not autoinit
- noinit = true
+ if not has_value then
+ if atlazy != null then
+ modelbuilder.error(atlazy, "Error: `lazy` attributes need a value.")
+ else if atlateinit != null then
+ modelbuilder.error(atlateinit, "Error: `lateinit` attributes need a value.")
+ end
+ has_value = true
+ return false
+ end
+ create_lazy
end
+ return true
end
redef fun build_signature(modelbuilder)
mpropdef.static_mtype = mtype
end
- do
- var msignature = new MSignature(new Array[MParameter], mtype)
- mreadpropdef.msignature = msignature
- end
+ build_read_signature
- var mwritepropdef = self.mwritepropdef
- if mwritepropdef != null then
- var mwritetype = mtype
- if is_optional then
- mwritetype = mwritetype.as_nullable
- end
- var name: String
- name = n_id2.text
- var mparameter = new MParameter(name, mwritetype, false)
- var msignature = new MSignature([mparameter], null)
- mwritepropdef.msignature = msignature
- end
+ if self.mwritepropdef != null then build_write_signature
var mlazypropdef = self.mlazypropdef
if mlazypropdef != null then
check_repeated_types(modelbuilder)
end
+ # Build the read method signature
+ # `except`: mreadpropdef != null
+ # `expect`: mtype != null
+ fun build_read_signature
+ is
+ expect(mreadpropdef != null and mtype != null)
+ do
+ var msignature = new MSignature(new Array[MParameter], mtype)
+ mreadpropdef.msignature = msignature
+ end
+
+ # Build the write method signature
+ # `except`: mwritepropdef != null
+ # `expect`: mtype != null
+ fun build_write_signature
+ is
+ expect(mwritepropdef != null and mtype != null)
+ do
+ var mwritetype = mtype.as(not null)
+ if is_optional then
+ mwritetype = mwritetype.as_nullable
+ end
+ var mparameter = new MParameter(name, mwritetype, false)
+ var msignature = new MSignature([mparameter], null)
+ mwritepropdef.msignature = msignature
+ end
+
+ # Create a new setter for the attribute.
+ #
+ # `modelbuilder`: It's used to link the new `mwritepropdef` and `self`
+ # `visibility`: Is the setter has the same visibilty of the `mreadpropdef`.
+ # If `not is_same_visibility and mreadpropdef.mproperty.visibility > protected_visibility` the `mwritepropdef` visibility will be set to protected.
+ fun create_setter(modelbuilder: ModelBuilder, is_same_visibility: nullable Bool): AAttrPropdef
+ is
+ expect(mreadpropdef != null) # Use to define the visibility, the mclassdef and the doc of the `mwritepropdef`
+ do
+ if mwritepropdef != null then return self # Self already has a `mwritepropdef`
+ var same_visibility = false
+ if is_same_visibility != null then same_visibility = is_same_visibility
+
+ self.build_write_property(modelbuilder, mreadpropdef.mclassdef, same_visibility)
+ self.build_write_signature
+ return self
+ end
+
+ # Set the default `self` value
+ #
+ # `expr`: Represents the default value of the attribute. If `expr isa ABlockExpr` `self.n_block` will be set.
+ fun define_default(expr: AExpr): AAttrPropdef
+ do
+ self.has_value = true
+ if expr isa ABlockExpr then
+ self.n_block = expr
+ else
+ self.n_expr = expr
+ end
+ return self
+ end
+
+ # Set `self` as optional
+ fun define_as_optional: AAttrPropdef
+ is
+ expect(has_value)
+ do
+ is_optional = true
+ return self
+ end
+
+ # Create the lazy attribute.
+ #
+ # see `mlazypropdef` for more information about this property.
+ fun create_lazy: AAttrPropdef
+ is
+ expect(has_value and mpropdef != null) # The only way to get a null `mpropdef` is when the attribute is defined as `abstract`. But if the attribute has a value, it cannot be abstract.
+ do
+ if self.mlazypropdef != null then return self # Self already has a `mlazypropdef`
+ is_lazy = true
+ var mlazyprop = new MAttribute(mpropdef.mclassdef, "lazy _" + name, self.location, none_visibility)
+ mlazyprop.is_fictive = true
+ var mlazypropdef = new MAttributeDef(mpropdef.mclassdef, mlazyprop, self.location)
+ mlazypropdef.is_fictive = true
+ self.mlazypropdef = mlazypropdef
+ return self
+ end
+
# Detect the static type from the value assigned to the attribute `self`
#
# Return the static type if it can be safely inferred.
# Collect all nodes from the current `model`.
private fun collect_model_nodes(model: Model): Collection[NeoNode] do
for mpackage in model.mpackages do
- to_node(mpackage)
- for mgroup in mpackage.mgroups do to_node(mgroup)
+ mpackage.to_node(nodes, model_name)
+ for mgroup in mpackage.mgroups do mgroup.to_node(nodes, model_name)
end
return nodes.values
end
# Nodes associated with MEntities.
private var nodes = new HashMap[MEntity, NeoNode]
- # Get the `NeoNode` associated with `mentity`.
- # `mentities` are stored locally to avoid duplication.
- fun to_node(mentity: MEntity): NeoNode do
- if nodes.has_key(mentity) then return nodes[mentity]
- if mentity isa MPackage then return mpackage_node(mentity)
- if mentity isa MGroup then return mgroup_node(mentity)
- if mentity isa MModule then return mmodule_node(mentity)
- if mentity isa MClass then return mclass_node(mentity)
- if mentity isa MClassDef then return mclassdef_node(mentity)
- if mentity isa MProperty then return mproperty_node(mentity)
- if mentity isa MPropDef then return mpropdef_node(mentity)
- if mentity isa MType then return mtype_node(mentity)
- if mentity isa MParameter then return mparameter_node(mentity)
- abort
- end
-
# Get the `MEntity` associated with `node`.
fun to_mentity(model: Model, node: NeoNode): MEntity do
if node.labels.has("MPackage") then return to_mpackage(model, node)
abort
end
- # Make a new `NeoNode` based on `mentity`.
- private fun make_node(mentity: MEntity): NeoNode do
- var node = new NeoNode
- nodes[mentity] = node
- node.labels.add "MEntity"
- node.labels.add model_name
- node["name"] = mentity.name
- if not mentity isa MSignature then
- #FIXME: MSignature is a MEntity, but has no model :/
- node["location"] = mentity.location.to_s
- end
- var mdoc = mentity.mdoc
- if mdoc != null then
- node["mdoc"] = new JsonArray.from(mdoc.content)
- node["mdoc_location"] = mdoc.location.to_s
- end
- return node
- end
-
- # Build a `NeoNode` representing `mpackage`.
- private fun mpackage_node(mpackage: MPackage): NeoNode do
- var node = make_node(mpackage)
- node.labels.add "MPackage"
- var root = mpackage.root
- if root != null then
- node.out_edges.add(new NeoEdge(node, "ROOT", to_node(root)))
- end
- return node
- end
-
# Build a new `MPackage` from a `node`.
#
# REQUIRE `node.labels.has("MPackage")`
return mpackage
end
- # Build a `NeoNode` representing `mgroup`.
- private fun mgroup_node(mgroup: MGroup): NeoNode do
- var node = make_node(mgroup)
- node.labels.add "MGroup"
- var parent = mgroup.parent
- node.out_edges.add(new NeoEdge(node, "PROJECT", to_node(mgroup.mpackage)))
- if parent != null then
- node.out_edges.add(new NeoEdge(node, "PARENT", to_node(parent)))
- end
- for mmodule in mgroup.mmodules do
- node.out_edges.add(new NeoEdge(node, "DECLARES", to_node(mmodule)))
- end
- for subgroup in mgroup.in_nesting.direct_smallers do
- node.in_edges.add(new NeoEdge(node, "NESTS", to_node(subgroup)))
- end
- return node
- end
-
# Build a new `MGroup` from a `node`.
#
# REQUIRE `node.labels.has("MGroup")`
return mgroup
end
- # Build a `NeoNode` representing `mmodule`.
- private fun mmodule_node(mmodule: MModule): NeoNode do
- var node = make_node(mmodule)
- node.labels.add "MModule"
- for parent in mmodule.in_importation.direct_greaters do
- node.out_edges.add(new NeoEdge(node, "IMPORTS", to_node(parent)))
- end
- for mclass in mmodule.intro_mclasses do
- node.out_edges.add(new NeoEdge(node, "INTRODUCES", to_node(mclass)))
- end
- for mclassdef in mmodule.mclassdefs do
- node.out_edges.add(new NeoEdge(node, "DEFINES", to_node(mclassdef)))
- end
- return node
- end
-
# Build a new `MModule` from a `node`.
#
# REQUIRE `node.labels.has("MModule")`
return mmodule
end
- # Build a `NeoNode` representing `mclass`.
- private fun mclass_node(mclass: MClass): NeoNode do
- var node = make_node(mclass)
- node.labels.add "MClass"
- node["kind"] = mclass.kind.to_s
- node["visibility"] = mclass.visibility.to_s
- if not mclass.mparameters.is_empty then
- var parameter_names = new Array[String]
- for p in mclass.mparameters do parameter_names.add(p.name)
- node["parameter_names"] = new JsonArray.from(parameter_names)
- end
- node.out_edges.add(new NeoEdge(node, "CLASSTYPE", to_node(mclass.mclass_type)))
- return node
- end
-
# Build a new `MClass` from a `node`.
#
# REQUIRE `node.labels.has("MClass")`
return mclass
end
- # Build a `NeoNode` representing `mclassdef`.
- private fun mclassdef_node(mclassdef: MClassDef): NeoNode do
- var node = make_node(mclassdef)
- node.labels.add "MClassDef"
- node.out_edges.add(new NeoEdge(node, "BOUNDTYPE", to_node(mclassdef.bound_mtype)))
- node.out_edges.add(new NeoEdge(node, "MCLASS", to_node(mclassdef.mclass)))
- for mproperty in mclassdef.intro_mproperties do
- node.out_edges.add(new NeoEdge(node, "INTRODUCES", to_node(mproperty)))
- end
- for mpropdef in mclassdef.mpropdefs do
- node.out_edges.add(new NeoEdge(node, "DECLARES", to_node(mpropdef)))
- end
- for sup in mclassdef.supertypes do
- node.out_edges.add(new NeoEdge(node, "INHERITS", to_node(sup)))
- end
- return node
- end
-
# Build a new `MClassDef` from a `node`.
#
# REQUIRE `node.labels.has("MClassDef")`
return mclassdef
end
- # Build a `NeoNode` representing `mproperty`.
- private fun mproperty_node(mproperty: MProperty): NeoNode do
- var node = make_node(mproperty)
- node.labels.add "MProperty"
- node["visibility"] = mproperty.visibility.to_s
- if mproperty isa MMethod then
- node.labels.add "MMethod"
- node["is_init"] = mproperty.is_init
- else if mproperty isa MAttribute then
- node.labels.add "MAttribute"
- else if mproperty isa MVirtualTypeProp then
- node.labels.add "MVirtualTypeProp"
- else if mproperty isa MInnerClass then
- node.labels.add "MInnerClass"
- node.out_edges.add(new NeoEdge(node, "NESTS", to_node(mproperty.inner)))
- end
- node.out_edges.add(new NeoEdge(node, "INTRO_CLASSDEF", to_node(mproperty.intro_mclassdef)))
- return node
- end
-
# Build a new `MProperty` from a `node`.
#
# REQUIRE `node.labels.has("MProperty")`
return mprop
end
- # Build a `NeoNode` representing `mpropdef`.
- private fun mpropdef_node(mpropdef: MPropDef): NeoNode do
- var node = make_node(mpropdef)
- node.labels.add "MPropDef"
- node.out_edges.add(new NeoEdge(node, "DEFINES", to_node(mpropdef.mproperty)))
- if mpropdef isa MMethodDef then
- node.labels.add "MMethodDef"
- node["is_abstract"] = mpropdef.is_abstract
- node["is_intern"] = mpropdef.is_intern
- node["is_extern"] = mpropdef.is_extern
- var msignature = mpropdef.msignature
- if msignature != null then
- node.out_edges.add(new NeoEdge(node, "SIGNATURE", to_node(msignature)))
- end
- else if mpropdef isa MAttributeDef then
- node.labels.add "MAttributeDef"
- var static_mtype = mpropdef.static_mtype
- if static_mtype != null then
- node.out_edges.add(new NeoEdge(node, "TYPE", to_node(static_mtype)))
- end
- else if mpropdef isa MVirtualTypeDef then
- node.labels.add "MVirtualTypeDef"
- var bound = mpropdef.bound
- if bound != null then
- node.out_edges.add(new NeoEdge(node, "BOUND", to_node(bound)))
- end
- else if mpropdef isa MInnerClassDef then
- node.labels.add "MInnerClassDef"
- node.out_edges.add(new NeoEdge(node, "NESTS", to_node(mpropdef.inner)))
- end
- return node
- end
-
# Build a new `MPropDef` from a `node`.
#
# REQUIRE `node.labels.has("MPropDef")`
return mpropdef
end
- # Build a `NeoNode` representing `mtype`.
- private fun mtype_node(mtype: MType): NeoNode do
- var node = make_node(mtype)
- node.labels.add "MType"
- if mtype isa MClassType then
- node.labels.add "MClassType"
- node.out_edges.add(new NeoEdge(node, "CLASS", to_node(mtype.mclass)))
- for arg in mtype.arguments do
- node.out_edges.add(new NeoEdge(node, "ARGUMENT", to_node(arg)))
- end
- if mtype isa MGenericType then
- node.labels.add "MGenericType"
- end
- else if mtype isa MVirtualType then
- node.labels.add "MVirtualType"
- node.out_edges.add(new NeoEdge(node, "PROPERTY", to_node(mtype.mproperty)))
- else if mtype isa MParameterType then
- node.labels.add "MParameterType"
- node["rank"] = mtype.rank
- node.out_edges.add(new NeoEdge(node, "CLASS", to_node(mtype.mclass)))
- else if mtype isa MNullableType then
- node.labels.add "MNullableType"
- node.out_edges.add(new NeoEdge(node, "TYPE", to_node(mtype.mtype)))
- else if mtype isa MSignature then
- node.labels.add "MSignature"
- var names = new JsonArray
- var rank = 0
- for mparameter in mtype.mparameters do
- names.add mparameter.name
- var pnode = mparameter_node(mparameter)
- pnode["rank"] = rank
- node.out_edges.add(new NeoEdge(node, "PARAMETER", pnode))
- rank += 1
- end
- if not names.is_empty then node["parameter_names"] = names
- var return_mtype = mtype.return_mtype
- if return_mtype != null then
- node.out_edges.add(new NeoEdge(node, "RETURNTYPE", to_node(return_mtype)))
- end
- else if mtype isa MRawType then
- node.labels.add "MRawType"
- var text = new JsonArray
- var rank = 0
- for part in mtype.parts do
- text.add part.text
- if part.target != null then
- var pnode = mtypepart_node(part)
- pnode["rank"] = rank
- node.out_edges.add(new NeoEdge(node, "LINK", pnode))
- end
- rank += 1
- end
- if not text.is_empty then node["text"] = text
- end
- return node
- end
-
- # Build a `NeoNode` representing `mtypepart`.
- private fun mtypepart_node(mtypepart: MTypePart): NeoNode do
- var node = make_node(mtypepart)
- node.labels.add "MTypePart"
- if mtypepart.target != null then
- var target_node = to_node(mtypepart.target.as(not null))
- node.out_edges.add(new NeoEdge(node, "TARGET", target_node))
- end
- return node
- end
-
# Build a new `MType` from a `node`.
#
# REQUIRE `node.labels.has("MType")`
abort
end
- # Build a `NeoNode` representing `mparameter`.
- private fun mparameter_node(mparameter: MParameter): NeoNode do
- var node = make_node(mparameter)
- node.labels.add "MParameter"
- node["name"] = mparameter.name
- node["is_vararg"] = mparameter.is_vararg
- node.out_edges.add(new NeoEdge(node, "TYPE", to_node(mparameter.mtype)))
- return node
- end
-
# Build a new `MParameter` from `node`.
#
# REQUIRE `node.labels.has("MParameter")`
end
end
end
+
+redef class MPackage
+ 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
+ var root = root
+ if root != null then
+ node.out_edges.add(new NeoEdge(node, "ROOT", root.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+redef class MGroup
+ 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
+ var parent = parent
+ node.out_edges.add(new NeoEdge(node, "PROJECT", mpackage.to_node(nodes, model_name)))
+ if parent != null then
+ node.out_edges.add(new NeoEdge(node, "PARENT", parent.to_node(nodes, model_name)))
+ end
+ for mmodule in mmodules do
+ node.out_edges.add(new NeoEdge(node, "DECLARES", mmodule.to_node(nodes, model_name)))
+ end
+ for subgroup in in_nesting.direct_smallers do
+ node.in_edges.add(new NeoEdge(node, "NESTS", subgroup.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+redef class MModule
+ 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
+ for parent in in_importation.direct_greaters do
+ node.out_edges.add(new NeoEdge(node, "IMPORTS", parent.to_node(nodes, model_name)))
+ end
+ for mclass in intro_mclasses do
+ node.out_edges.add(new NeoEdge(node, "INTRODUCES", mclass.to_node(nodes, model_name)))
+ end
+ for mclassdef in mclassdefs do
+ node.out_edges.add(new NeoEdge(node, "DEFINES", mclassdef.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+redef class MClass
+ 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["kind"] = kind.to_s
+ node["visibility"] = visibility.to_s
+ if not mparameters.is_empty then
+ var parameter_names = new Array[String]
+ for p in mparameters do parameter_names.add(p.name)
+ node["parameter_names"] = new JsonArray.from(parameter_names)
+ end
+ node.out_edges.add(new NeoEdge(node, "CLASSTYPE", mclass_type.to_node(nodes, model_name)))
+ return node
+ end
+end
+
+redef class MClassDef
+ 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.out_edges.add(new NeoEdge(node, "BOUNDTYPE", bound_mtype.to_node(nodes, model_name)))
+ node.out_edges.add(new NeoEdge(node, "MCLASS", mclass.to_node(nodes, model_name)))
+ for mproperty in intro_mproperties do
+ node.out_edges.add(new NeoEdge(node, "INTRODUCES", mproperty.to_node(nodes, model_name)))
+ end
+ for mpropdef in mpropdefs do
+ node.out_edges.add(new NeoEdge(node, "DECLARES", mpropdef.to_node(nodes, model_name)))
+ end
+ for sup in supertypes do
+ node.out_edges.add(new NeoEdge(node, "INHERITS", sup.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+redef class MProperty
+ 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 = make_node(nodes, model_name)
+ node.labels.add "MProperty"
+ node["visibility"] = visibility.to_s
+ node.out_edges.add(new NeoEdge(node, "INTRO_CLASSDEF", intro_mclassdef.to_node(nodes, model_name)))
+ node.labels.add self.class_name
+ return node
+ end
+end
+
+redef class MMethod
+ 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_init"] = is_init
+ return node
+ end
+end
+
+redef class MInnerClass
+ 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.out_edges.add(new NeoEdge(node, "NESTS", inner.to_node(nodes, model_name)))
+ return node
+ end
+end
+
+redef class MPropDef
+ 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 = make_node(nodes, model_name)
+ node.labels.add "MPropDef"
+ node.out_edges.add(new NeoEdge(node, "DEFINES", mproperty.to_node(nodes, model_name)))
+ node.labels.add self.class_name
+ return node
+ end
+end
+
+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
+
+redef class MAttributeDef
+ 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
+ var static_mtype = static_mtype
+ if static_mtype != null then
+ node.out_edges.add(new NeoEdge(node, "TYPE", static_mtype.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+redef class MVirtualTypeDef
+ 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
+ var bound = bound
+ if bound != null then
+ node.out_edges.add(new NeoEdge(node, "BOUND", bound.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+redef class MInnerClassDef
+ 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.out_edges.add(new NeoEdge(node, "NESTS", inner.to_node(nodes, model_name)))
+ return node
+ end
+end
+
+redef class MTypePart
+ 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
+ if self.target != null then
+ var target_node = self.target.as(not null).to_node(nodes, model_name)
+ node.out_edges.add(new NeoEdge(node, "TARGET", target_node))
+ end
+ return node
+ end
+end
+
+redef class MParameter
+ 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["name"] = self.name
+ node["is_vararg"] = self.is_vararg
+ node.out_edges.add(new NeoEdge(node, "TYPE", self.mtype.to_node(nodes, model_name)))
+ return node
+ end
+end
+
+redef class MClassType
+ 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.labels.add "MClassType"
+ node.out_edges.add(new NeoEdge(node, "CLASS", mclass.to_node(nodes, model_name)))
+ for arg in arguments do
+ node.out_edges.add(new NeoEdge(node, "ARGUMENT", arg.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+
+redef class MGenericType
+ 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.labels.add "MGenericType"
+ return node
+ end
+end
+
+redef class MVirtualType
+ 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.labels.add "MVirtualType"
+ node.out_edges.add(new NeoEdge(node, "PROPERTY", mproperty.to_node(nodes, model_name)))
+ return node
+ end
+end
+
+redef class MParameterType
+ 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.labels.add "MParameterType"
+ node["rank"] = rank
+ node.out_edges.add(new NeoEdge(node, "CLASS", mclass.to_node(nodes, model_name)))
+ return node
+ end
+end
+
+redef class MNullableType
+ 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.labels.add "MNullableType"
+ node.out_edges.add(new NeoEdge(node, "TYPE", mtype.to_node(nodes, model_name)))
+ return node
+ end
+end
+
+redef class MSignature
+ 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.labels.add "MSignature"
+ var names = new JsonArray
+ var rank = 0
+ for mparameter in mparameters do
+ names.add mparameter.name
+ var pnode = mparameter.to_node(nodes, model_name)
+ pnode["rank"] = rank
+ node.out_edges.add(new NeoEdge(node, "PARAMETER", pnode))
+ rank += 1
+ end
+ if not names.is_empty then node["parameter_names"] = names
+ var return_mtype = return_mtype
+ if return_mtype != null then
+ node.out_edges.add(new NeoEdge(node, "RETURNTYPE", return_mtype.to_node(nodes, model_name)))
+ end
+ return node
+ end
+end
+
+redef class MRawType
+ 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.labels.add "MRawType"
+ var text = new JsonArray
+ var rank = 0
+ for part in self.parts do
+ text.add part.text
+ if part.target != null then
+ var pnode = part.to_node(nodes, model_name)
+ pnode["rank"] = rank
+ node.out_edges.add(new NeoEdge(node, "LINK", pnode))
+ end
+ rank += 1
+ end
+ if not text.is_empty then node["text"] = text
+ return node
+ end
+end
+
+redef class MType
+ 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 = make_node(nodes, model_name)
+ node.labels.add "MType"
+ return node
+ end
+end
+
+redef class MEntity
+ # Build a `NeoNode` representing `self`.
+ private fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
+ if nodes.has_key(self) then return nodes[self]
+ var node = make_node(nodes, model_name)
+ node.labels.add self.class_name
+ return node
+ end
+
+ # Make a new `NeoNode` based on `mentity`.
+ private fun make_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode do
+ var node = new NeoNode
+ nodes[self] = node
+ node.labels.add "MEntity"
+ if model_name != null then node.labels.add model_name
+ node["name"] = self.name
+ if not self isa MSignature then
+ #FIXME: MSignature is a MEntity, but has no model :/
+ node["location"] = self.location.to_s
+ end
+ var mdoc = self.mdoc
+ if mdoc != null then
+ node["mdoc"] = new JsonArray.from(mdoc.content)
+ node["mdoc_location"] = mdoc.location.to_s
+ end
+ return node
+ end
+end
end
modelbuilder.run_phases
+toolcontext.run_global_phases(modelbuilder.parsed_modules)
if toolcontext.opt_only_metamodel.value then toolcontext.quit
var cname
if mproperty.is_init then
- if mproperty.name == "init" or mproperty.name == "new" then
+ if mproperty.name == "init" or mproperty.name == "new" or mproperty.name == "defaultinit" then
cname = "new_{recv_mtype.mangled_cname}"
else
cname = "new_{recv_mtype.mangled_cname}_{mproperty.short_cname}"
mmodule, mtype, meth_name )
if meth == null then
- meth_name = "init"
+ meth_name = "defaultinit"
meth = toolcontext.modelbuilder.try_get_mproperty_by_name2( self,
mmodule, mtype, meth_name )
end
do
var cname
if self.is_init then
- if self.name == "init" or self.name == "new" then
+ if self.name == "init" or self.name == "new" or self.name == "defaultinit" then
cname = "new_{recv_mtype.mangled_cname}"
else
cname = "new_{recv_mtype.mangled_cname}_{self.short_cname}"
# See the License for the specific language governing permissions and
# limitations under the License.
-
# Rapid type analysis on the AST
#
# Rapid type analysis is an analyse that aproximates the set of live classes
v.add_monomorphic_send(vararg, self.modelbuilder.force_get_primitive_method(node, "with_native", vararg.mclass, self.mainmodule))
end
- # TODO? new_msignature
var sig = msignature
var osig = mmeth.intro.msignature.as(not null)
for i in [0..sig.arity[ do
if npropdef isa AClassdef then
if mmethoddef.mproperty.is_root_init then
+ # Final init call
if not mmethoddef.is_intro then
self.add_super_send(v.receiver, mmethoddef)
end
+ else if mmethoddef.mclassdef.default_init == mmethoddef then
+ # default_init call
+ for i in mmethoddef.initializers do
+ if i isa MMethod then self.add_send(v.receiver, i)
+ end
else
npropdef.debug "cannot RTA {mmethoddef}"
abort
v.enter_visit(npropdef.n_block)
end
end
-
end
fun add_cast(mtype: MType)
end
end
+redef class ACallrefExpr
+ redef fun accept_rapid_type_visitor(v)
+ do
+ super
+ v.add_type(mtype.as(MClassType))
+ end
+end
redef class ASendReassignFormExpr
redef fun accept_rapid_type_visitor(v)
var auto_super_inits = new Array[CallSite]
# The look for new-style super constructors (called from a old style constructor)
- var the_root_init_mmethod = modelbuilder.the_root_init_mmethod
- if the_root_init_mmethod != null and auto_super_inits.is_empty then
- var candidatedefs = the_root_init_mmethod.lookup_definitions(mmodule, anchor)
- if candidatedefs.is_empty then
- # skip broken
- is_broken = true
- return
- end
+ var candidatedefs = get_super_candidatedefs(modelbuilder)
+
+ if not candidatedefs.is_empty and auto_super_inits.is_empty then
var candidatedef = candidatedefs.first
if candidatedefs.length > 1 then
return
end
- var msignature = candidatedef.new_msignature or else candidatedef.msignature
+ var msignature = candidatedef.msignature
msignature = msignature.resolve_for(recvtype, anchor, mmodule, true)
- if msignature.arity > 0 then
+ if msignature.arity > mpropdef.msignature.arity then
modelbuilder.error(self, "Error: cannot do an implicit constructor call to `{candidatedef}{msignature}`. Expected at least `{msignature.arity}` arguments.")
is_broken = true
return
end
- var callsite = new CallSite(hot_location, recvtype, mmodule, anchor, true, the_root_init_mmethod, candidatedef, msignature, false)
+ if candidatedef.mproperty != mpropdef.mproperty then
+ var i = 0
+ for candidat_mparameter in msignature.mparameters do
+ var actual_mparameter = mpropdef.msignature.mparameters[i]
+ if not candidat_mparameter.mtype.is_subtype(mmodule, anchor, actual_mparameter.mtype) then
+ modelbuilder.error(self, "Type Error: expected argument #{i} of type `{candidat_mparameter.mtype}`, got implicit argument `{candidat_mparameter.name}` of type `{actual_mparameter.mtype}`. Signature is {msignature}")
+ return
+ end
+ i += 1
+ end
+ end
+
+ var callsite = new CallSite(hot_location, recvtype, mmodule, anchor, true, candidatedef.mproperty, candidatedef, msignature, false)
auto_super_inits.add(callsite)
- modelbuilder.toolcontext.info("Auto-super init for {mpropdef} to {the_root_init_mmethod.full_name}", 4)
+ modelbuilder.toolcontext.info("Auto-super init for {mpropdef} to {candidatedef.full_name}", 4)
+ else if candidatedefs.is_empty then
+ # skip broken
+ is_broken = true
+ return
end
if auto_super_inits.is_empty then
modelbuilder.error(self, "Error: no constructors to call implicitly in `{mpropdef}`. Call one explicitly.")
self.auto_super_inits = auto_super_inits
end
+ # This method returns the list of possible candidates for the current definition.
+ #
+ # Warning this method supports super call from old_style_init to default_inits without signature verification!!!
+ private fun get_super_candidatedefs(modelbuilder: ModelBuilder): Array[MMethodDef]
+ do
+ var candidatedefs = new Array[MMethodDef]
+
+ var mclassdef = self.parent.as(AClassdef).mclassdef
+ if mclassdef == null or mclassdef.is_broken then return candidatedefs # skip error
+ var mpropdef = self.mpropdef
+ if mpropdef == null or mpropdef.is_broken then return candidatedefs # skip error
+ var mmodule = mpropdef.mclassdef.mmodule
+ var anchor = mclassdef.bound_mtype
+ var mproperty = mpropdef.mproperty
+
+ # The look for new-style super constructors (called from a old style constructor)
+ var the_root_init_mmethod = modelbuilder.the_root_init_mmethod
+
+ if mpropdef.is_old_style_init then
+ var superprop: nullable MMethodDef = null
+ for mclass in mclassdef.mclass.in_hierarchy(mmodule).direct_greaters do
+ candidatedefs.add(mclass.intro.default_init.as(not null))
+ end
+ else
+ candidatedefs = the_root_init_mmethod.lookup_definitions(mmodule, anchor)
+ end
+ return candidatedefs
+ end
end
redef class ANode
end
end
+ # Display a warning on `node` if `not mpropdef.is_fictive`
+ fun display_warning(node: ANode, tag: String, message: String)
+ do
+ if not mpropdef.is_fictive then self.modelbuilder.warning(node, tag, message)
+ end
+
fun anchor_to(mtype: MType): MType
do
return mtype.anchor_to(mmodule, anchor)
return self.visit_expr_subtype(nexpr, self.type_bool(nexpr))
end
-
fun check_expr_cast(node: ANode, nexpr: AExpr, ntype: AType): nullable MType
do
var sub = nexpr.mtype
if sup == null then return null # Forward error
if sup == sub then
- self.modelbuilder.warning(node, "useless-type-test", "Warning: expression is already a `{sup}`.")
+ display_warning(node, "useless-type-test", "Warning: expression is already a `{sup}`.")
else if self.is_subtype(sub, sup) then
- self.modelbuilder.warning(node, "useless-type-test", "Warning: expression is already a `{sup}` since it is a `{sub}`.")
+ display_warning(node, "useless-type-test", "Warning: expression is already a `{sup}` since it is a `{sub}`.")
end
return sup
end
fun check_can_be_null(anode: ANode, mtype: MType): Bool
do
if mtype isa MNullType then
- modelbuilder.warning(anode, "useless-null-test", "Warning: expression is always `null`.")
+ display_warning(anode, "useless-null-test", "Warning: expression is always `null`.")
return true
end
if can_be_null(mtype) then return true
if mtype isa MFormalType then
var res = anchor_to(mtype)
- modelbuilder.warning(anode, "useless-null-test", "Warning: expression is not null, since it is a `{mtype}: {res}`.")
+ display_warning(anode, "useless-null-test", "Warning: expression is not null, since it is a `{mtype}: {res}`.")
else
- modelbuilder.warning(anode, "useless-null-test", "Warning: expression is not null, since it is a `{mtype}`.")
+ display_warning(anode, "useless-null-test", "Warning: expression is not null, since it is a `{mtype}`.")
end
return false
end
var mproperty = self.try_get_mproperty_by_name2(node, unsafe_type, name)
if name == "new" and mproperty == null then
- name = "init"
+ name = "defaultinit"
mproperty = self.try_get_mproperty_by_name2(node, unsafe_type, name)
+ if mproperty == null then
+ name = "init"
+ mproperty = self.try_get_mproperty_by_name2(node, unsafe_type, name)
+ end
end
if mproperty == null then
if recv_is_self then
- self.modelbuilder.error(node, "Error: method or variable `{name}` unknown in `{recvtype}`.")
+ # FIXME This test was added to display a more explicit error when a potential duplication of root object class.
+ if name == "init" then
+ self.modelbuilder.error(node, "Possible duplication of the root class `Object`")
+ else
+ self.modelbuilder.error(node, "Error: method or variable `{name}` unknown in `{recvtype}`.")
+ end
else if recvtype.need_anchor then
self.modelbuilder.error(node, "Error: method `{name}` does not exists in `{recvtype}: {unsafe_type}`.")
else
if info != null and self.mpropdef.mproperty.deprecation == null then
var mdoc = info.mdoc
if mdoc != null then
- self.modelbuilder.warning(node, "deprecated-method", "Deprecation Warning: method `{mproperty.name}` is deprecated: {mdoc.content.first}")
+ display_warning(node, "deprecated-method", "Deprecation Warning: method `{mproperty.name}` is deprecated: {mdoc.content.first}")
else
- self.modelbuilder.warning(node, "deprecated-method", "Deprecation Warning: method `{mproperty.name}` is deprecated.")
+ display_warning(node, "deprecated-method", "Deprecation Warning: method `{mproperty.name}` is deprecated.")
end
end
else if propdefs.length == 1 then
mpropdef = propdefs.first
else
- self.modelbuilder.warning(node, "property-conflict", "Warning: conflicting property definitions for property `{mproperty.name}` in `{unsafe_type}`: {propdefs.join(" ")}")
+ display_warning(node, "property-conflict", "Warning: conflicting property definitions for property `{mproperty.name}` in `{unsafe_type}`: {propdefs.join(" ")}")
mpropdef = mproperty.intro
end
# The `build_callsite_by_propdef` builds the callsite directly with the `mprodef` passed in argument.
fun build_callsite_by_propdef(node: ANode, recvtype: MType, mpropdef: MMethodDef, recv_is_self: Bool): nullable CallSite
do
- var msignature = mpropdef.new_msignature or else mpropdef.msignature
+ var msignature = mpropdef.msignature
if msignature == null then return null # skip error
msignature = resolve_for(msignature, recvtype, recv_is_self).as(MSignature)
return build_callsite_by_name(node, recvtype, name, recv_is_self)
end
-
# Visit the expressions of args and check their conformity with the corresponding type in signature
# The point of this method is to handle varargs correctly
# Note: The signature must be correctly adapted
# Other cases are managed later
end
-
#debug("CALL {unsafe_type}.{msignature}")
# Associate each parameter to a position in the arguments
end
return res
end
+
+ # Type the expression as if located in `visited_mpropdef`
+ # `TypeVisitor` and `PostTypingVisitor` will be used to do the typing, see them for more information.
+ #
+ # `visited_mpropdef`: Correspond to the evaluation context in which the expression is located.
+ fun do_typing(modelbuilder: ModelBuilder, visited_mpropdef: MPropDef)
+ do
+ var type_visitor = new TypeVisitor(modelbuilder, visited_mpropdef)
+ type_visitor.visit_stmt(self)
+ var post_visitor = new PostTypingVisitor(type_visitor)
+ post_visitor.enter_visit(self)
+ end
end
redef class ABlockExpr
end
end
-
redef class AContinueExpr
redef fun accept_typing(v)
do
end
end
-
redef class ANotExpr
redef fun accept_typing(v)
do
end
if useless then
assert ntype != null
- v.modelbuilder.warning(ntype, "useless-type", "Warning: useless type declaration `{mtype}` in literal Array since it can be inferred from the elements type.")
+ v.display_warning(ntype, "useless-type", "Warning: useless type declaration `{mtype}` in literal Array since it can be inferred from the elements type.")
end
self.element_mtype = mtype
# get the constructor
var callsite
if self isa ACrangeExpr then
- callsite = v.build_callsite_by_name(self, mtype, "init", false)
+ callsite = v.build_callsite_by_name(self, mtype, "defaultinit", false)
else if self isa AOrangeExpr then
callsite = v.build_callsite_by_name(self, mtype, "without_last", false)
else
var args = compute_raw_arguments
- if not self isa ACallrefExpr then
- callsite.check_signature(v, node, args)
- end
+ if not self isa ACallrefExpr then callsite.check_signature(v, node, args)
if callsite.mproperty.is_init then
var vmpropdef = v.mpropdef
if mtype == null or mtype2 == null then return
if mtype == v.type_bool(self) and (n_expr2 isa AFalseExpr or n_expr2 isa ATrueExpr) then
- v.modelbuilder.warning(self, "useless-truism", "Warning: useless comparison to a Bool literal.")
+ v.display_warning(self, "useless-truism", "Warning: useless comparison to a Bool literal.")
end
if not mtype2 isa MNullType then return
redef fun compute_raw_arguments do return new Array[AExpr]
end
-
redef class ACallExpr
redef fun property_name do return n_qid.n_id.text
redef fun property_node do return n_qid
end
redef class AInitExpr
- redef fun property_name do return "init"
+ redef fun property_name do if n_args.n_exprs.is_empty then return "init" else return "defaultinit"
redef fun property_node do return n_kwinit
redef fun compute_raw_arguments do return n_args.to_a
end
# end
#
# var a = new A[Int]
- # var f = &a.toto <- without anchor : ProcRef1[E]
- # ^--- with anchor : ProcRef[Int]
+ # var f = &a.toto # without anchor : ProcRef1[E]
+ # # with anchor : ProcRef[Int]
# ~~~~
- var routine_type = routine_mclass.get_mtype(types_list).anchor_to(v.mmodule, recv.as(MClassType))
-
+ # However, we can only anchor if we can resolve every formal
+ # parameter, here's an example where we can't.
+ # ~~~~nitish
+ # class A[E]
+ # fun bar: A[E] do return self
+ # fun foo: Fun0[A[E]] do return &bar # here we can't anchor
+ # end
+ # var f1 = a1.foo # when this expression will be evaluated,
+ # # `a1` will anchor `&bar` returned by `foo`.
+ # print f1.call
+ # ~~~~
+ var routine_type = routine_mclass.get_mtype(types_list)
+ if not recv.need_anchor then
+ routine_type = routine_type.anchor_to(v.mmodule, recv.as(MClassType))
+ end
is_typed = true
self.mtype = routine_type
end
return
end
- var msignature = superprop.new_msignature or else superprop.msignature.as(not null)
+ var msignature = superprop.msignature.as(not null)
msignature = v.resolve_for(msignature, recvtype, true).as(MSignature)
var callsite = new CallSite(hot_location, recvtype, v.mmodule, v.anchor, true, superprop.mproperty, superprop, msignature, false)
end
end
-
redef class AAttrAssignExpr
redef fun accept_typing(v)
do
self.mtype = mtype.as_notnull
if not v.can_be_null(mtype) then
- v.modelbuilder.warning(self, "useless-safe", "Warning: useless safe operator `?` on non-nullable value.")
+ v.display_warning(self, "useless-safe", "Warning: useless safe operator `?` on non-nullable value.")
return
end
end
var mtype = v.resolve_mtype(ntype)
if mtype != null and mtype != expr then
var umtype = v.anchor_to(mtype)
- v.modelbuilder.warning(self, "debug", "Found type {expr} (-> {unsafe}), expected {mtype} (-> {umtype})")
+ v.display_warning(self, "debug", "Found type {expr} (-> {unsafe}), expected {mtype} (-> {umtype})")
end
self.is_typed = true
end
import test_phase
# We usualy need specific phases
-# NOTE: `frontend` is sufficient in most case (it is often too much)
+# NOTE: `frontend` is sufficient in most cases (it is often too much)
import frontend
# The body of the specific work.
# Add optimization of the method dispatch
redef fun callsite(callsite: nullable CallSite, arguments: Array[Instance]): nullable Instance
do
- var initializers = callsite.mpropdef.initializers
- if initializers.is_empty then return send_optimize(callsite.as(not null), arguments)
-
- var recv = arguments.first
- var i = 1
- for p in initializers do
- if p isa MMethod then
- var args = [recv]
- for x in p.intro.msignature.mparameters do
- args.add arguments[i]
- i += 1
- end
- self.send(p, args)
- else if p isa MAttribute then
- assert recv isa MutableInstance
- write_attribute(p, recv, arguments[i])
- i += 1
- else abort
- end
- assert i == arguments.length
-
- return send_optimize(callsite.as(not null), [recv])
+ return send_optimize(callsite.as(not null), arguments)
end
# Try to have the most efficient implementation of the method dispatch
class Integer
var val: Int
- init(val: Int) do _val = val
fun output do _val.output
end
class C1
super A
- init(j: Int) do
+ init(j: Int)
+ is
+ old_style_init
+ do
super
j.output
end
class D1
super A
- init(j: Int) do
+ init(j: Int)
+ is
+ old_style_init
+ do
super
j.output
end
class E1
super A
- init(j: Bool) do
+ init(j: Bool)
+ is
+ old_style_init
+ do
super(8)#alt4#super
j.output
end
class C2
super A
- init(j: Int) do
+ init(j: Int)
+ is
+ old_style_init
+ do
super(j)
j.output
end
class D2
super A
- init(j: Int) do
+ init(j: Int)
+ is
+ old_style_init
+ do
super(j)
j.output
end
class E2
super A
- init(j: Bool) do
+ init(j: Bool)
+ is
+ old_style_init
+ do
super(11)#alt5#super(j)
j.output
end
class C3
super A
- init(j: Int) do
+ init(j: Int)
+ is
+ old_style_init
+ do
super(j)#alt6#
j.output
end
class D3
super A
- init(j: Int) do
+ init(j: Int)
+ is
+ old_style_init
+ do
super(j)#alt6#
j.output
end
class E3
super A
- init(j: Bool) do
+ init(j: Bool)
+ is
+ old_style_init
+ do
super(14)#alt6#
j.output
end
class F1
super A
- init(j: Int, k: Bool) do
+ init(j: Int, k: Bool)
+ is
+ old_style_init
+ do
super
j.output
end
class F2
super A
- init(j: Int, k: Bool) do
+ init(j: Int, k: Bool)
+ is
+ old_style_init
+ do
super(j)#alt6#
j.output
end
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+redef class Int
+ fun foo do print self
+end
+
+class A
+ var x: Int
+end
+
+class B
+ var a: nullable A = null
+end
+
+class C
+ var x: Int
+ var c: nullable C = null
+end
+
+class D
+ var x: nullable Int
+ var d: nullable D = null
+end
+
+var b = new B
+
+#alt1#b.a?.x.foo
+
+var a = new A(10)
+
+b.a = a
+print "b.a.x: {b.a?.x or else "nothing"}"
+
+var c1 = new C(1)
+var c2 = new C(10)
+var c3 = new C(100)
+c1.c = c2
+c2.c = c3
+
+print c1.c?.c?.x or else "null"
+print c1.c?.c?.c or else "null"
+
+var d1 = new D(1)
+var d2 = new D(10)
+var d3 = new D(null)
+
+d1.d = d2
+d2.d = d3
+
+print d1.d?.x or else "null"
+print d1.d?.d?.x or else "null"
class B
var val: Int
- init(v: Int)
- do
- 7.output
- self.val = v
- end
+ init do 7.output
fun run do val.output
end
class MyClass
fun foo(x: Int)
is
- expects(x == 1)
- ensures(x > 0)
+ expect(x == 1)
+ ensure(x > 0)
do
x = 0
end
class MyClass2
fun foo(bool: Bool)
is
- expects(not bool)
- ensures(not bool)
+ expect(not bool)
+ ensure(not bool)
do
if bool then print "Error"
end
# Verification if it's possible to define a contract in different context (abstract class, interface and class) and it's possible to inherit it.
class MyClass
- fun foo(x: Int, y: Float)is abstract, expects(x != 10)
+ fun foo(x: Int, y: Float)is abstract, expect(x != 10)
end
abstract class AbstractClass
- fun bar(x: Int, y: Float)is abstract, expects(x >= 1), ensures(y == 10.0)
+ fun bar(x: Int, y: Float)is abstract, expect(x >= 1), ensure(y == 10.0)
end
interface Interface
- fun baz(x: Int, y: Float)is abstract, ensures(y <= 10.0, y == 42.0)
+ fun baz(x: Int, y: Float)is abstract, ensure(y <= 10.0, y == 42.0)
end
class MyClass
fun foo(x: Int)
is
- expects(x == 1)
+ expect(x == 1)
do
x=1
end
fun bar(x: Float): Bool
is
- ensures(result)
+ ensure(result)
do
return true
end
redef fun foo(x: Int)
is
- ensures(x == 0)
+ ensure(x == 0)
do
x=0
end
redef fun bar(x: Float)
is
- expects(x == 1)
+ expect(x == 1)
do
return true
end
fun foo(x: Int)
is
- expects(bar == 10)
- ensures(x > 0)
+ expect(bar == 10)
+ ensure(x > 0)
do
if bar != 10 then print "Error"
end
fun foo(bool: Bool)
is
- expects(not self.baz)
- ensures(my_class.bar == 11)
+ expect(not self.baz)
+ ensure(my_class.bar == 11)
do
if baz then print "Error"
my_class.bar = 11
class MyClass
init construct(test: Int)
is
- expects(test > 10)
+ expect(test > 10)
do
end
class MyClass
fun foo(x: Int)
is
- ensures(x > 0)
+ ensure(x > 0)
do
end
class MyClass2
fun foo(bool: Bool)
is
- ensures(not bool)
+ ensure(not bool)
do
end
class MyClass
fun foo(x: Int)
is
- ensures(x > 0)
+ ensure(x > 0)
do
print "Good"
end
class MyClass
fun foo(x: Int, y: Float)
is
- ensures(x > 0)
+ ensure(x > 0)
do
print "Good"
end
redef fun foo(x: Int, y: Float)
is
- ensures(y == 1.2)
+ ensure(y == 1.2)
do
print "Good"
end
class MyClass
fun foo(x: Int): Int
is
- ensures(result > 0)
+ ensure(result > 0)
do
return x
end
class MyClass
fun foo(x: Int): Bool
is
- ensures(x > 0, result)
+ ensure(x > 0, result)
do
return true
end
redef fun foo(x: Int)
is
- ensures(not result)
+ ensure(not result)
do
return super
end
class MyClass
fun foo(x: Int, y: Float)
is
- ensures(x > 2)
+ ensure(x > 2)
do
end
redef fun foo(x: Int, y: Float)
is
- ensures(y > 1.0)
+ ensure(y > 1.0)
do
end
fun foo(x: Int)
is
- expects(bar_no_return)
- ensures(assert x == 1)
+ expect(bar_no_return)
+ ensure(assert x == 1)
do
x = 0
end
class MyClass
fun foo(x: Int)
is
- expects(x > 0)
+ expect(x > 0)
do
if x <= 0 then print "FAIL"
end
class MyClass2
fun foo(bool: Bool)
is
- expects(not bool)
+ expect(not bool)
do
if bool then print "FAIL"
end
class MyClass
fun foo(x: Int)
is
- expects(x > 0)
+ expect(x > 0)
do
if x <= 0 then print "FAIL"
end
class MyClass
fun foo(x: Int)
is
- expects(x > 0)
+ expect(x > 0)
do
if x <= 0 then print "FAIL"
end
redef fun foo(x: Int)
is
- expects(x == 0)
+ expect(x == 0)
do
if x < 0 then print "FAIL"
end
redef fun foo(x: Int)
is
- expects(x == 0)
+ expect(x == 0)
do
if x != 0 then print "Good"
end
fun foo(x: E)
is
- expects(x == 1)
+ expect(x == 1)
do
if x != 1 then print "Error x != 1"
end
fun add_all(x: Array[Object])
is
- expects(x.length != 0)
+ expect(x.length != 0)
do
real.add_all x
end
redef fun toto(e)
is
- ensures(e == 12)
+ ensure(e == 12)
do
print "toto MyArrayInt"
super e
redef fun toto(e)
is
- ensures(e == 11)
+ ensure(e == 11)
do
print "toto MyArrayInt2"
super e
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+class A
+
+ var null_attribut: nullable Int
+
+ fun set_null_attribut(i: nullable Int)
+ is
+ ensure(null_attribut == i)
+ do
+ null_attribut = i
+ end
+end
+
+
+var a = new A
+a.set_null_attribut
+a.set_null_attribut(10)
+a.set_null_attribut
fun foo(x: Int)
is
- expects(x == 10)
- expects(x >= 10)
+ expect(x == 10)
+ expect(x >= 10)
do
x = 0
end
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Test the resolution of contract when the static mpropdef does not have contract and the dynamic has one
+
+class MyClass
+ fun foo(x: Int)
+ do
+ x = 0
+ end
+end
+
+class MySubClass
+ super MyClass
+
+ redef fun foo(x)
+ is
+ ensure(x > 10)
+ do
+ if x < 10 then print "Error"
+ end
+end
+
+var first = new MyClass
+first.foo(1) # No contract on the mpropdef
+var second: MyClass = new MySubClass
+second.foo(2) #Fail
fun foo(x: VIRTUAL)
is
- expects(x == 1)
+ expect(x == 1)
do
end
class A
#1alt1#init do abort
- #1alt2#init(a: Int) do abort
+ #1alt2#init(a: Int) is old_style_init do abort
#1alt3#new do abort
#1alt4#new(c: Int) do abort
- #1alt5#init foo(a: Int) do abort
+ #1alt5#init foo(a: Int) is old_style_init do abort
#1alt6#new foo(c: Int) do abort
#1alt7#fun foo do end
#alt1#init do abort
- #alt2#init(b: Float) do abort
+ #alt2#init(b: Float)is old_style_init do abort
#alt3#new do abort
#alt4#new(d: Float) do abort
- #alt5#init foo(a: Float) do abort
+ #alt5#init foo(a: Float)is old_style_init do abort
#alt6#new foo(c: Float) do abort
#alt7#fun foo do end
end
-alt/base_arg_default_autoinit_alt1.nit:59,5--7: Error: expected at least 1 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 0. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected 2 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:74,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 2. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:77,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 3. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b, mandatory: Int)`; got 1. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:89,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b, mandatory: Int)`; got 2. See introduction at `core::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b, mandatory: Int)`; got 4. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:59,5--7: Error: expected at least 1 argument(s) for `defaultinit(mandatory: Int, optional: nullable Int)`; got 0. See introduction at `base_arg_default_autoinit_alt1::A::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected 2 argument(s) for `defaultinit(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `base_arg_default_autoinit_alt1::A::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected 4 argument(s) for `defaultinit(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `base_arg_default_autoinit_alt1::B::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:74,5--7: Error: expected 4 argument(s) for `defaultinit(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 2. See introduction at `base_arg_default_autoinit_alt1::B::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:77,5--7: Error: expected 4 argument(s) for `defaultinit(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 3. See introduction at `base_arg_default_autoinit_alt1::B::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected 4 argument(s) for `defaultinit(mandatory: Int, optional, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `base_arg_default_autoinit_alt1::B::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected 3 argument(s) for `defaultinit(optional_b: nullable Int, mandatory_b, mandatory: Int)`; got 1. See introduction at `base_arg_default_autoinit_alt1::C::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:89,5--7: Error: expected 3 argument(s) for `defaultinit(optional_b: nullable Int, mandatory_b, mandatory: Int)`; got 2. See introduction at `base_arg_default_autoinit_alt1::C::defaultinit`.
+alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected 3 argument(s) for `defaultinit(optional_b: nullable Int, mandatory_b, mandatory: Int)`; got 4. See introduction at `base_arg_default_autoinit_alt1::C::defaultinit`.
-alt/base_attr_annot_1alt1.nit:33,9--11: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
+alt/base_attr_annot_1alt1.nit:33,9--11: Error: expected 0 argument(s) for `defaultinit`; got 1. See introduction at `base_attr_annot_1alt1::B::defaultinit`.
-alt/base_attr_annot_alt1.nit:33,9--11: Error: expected 1 argument(s) for `init(a: Object)`; got 0. See introduction at `core::Object::init`.
+alt/base_attr_annot_alt1.nit:33,9--11: Error: expected 1 argument(s) for `defaultinit(a: Object)`; got 0. See introduction at `base_attr_annot_alt1::B::defaultinit`.
-Runtime error: Uninitialized attribute _a1 (alt/base_attr_nullable_alt1.nit:38)
+Runtime error: Uninitialized attribute _a1 (alt/base_attr_nullable_alt1.nit:37)
-Runtime error: Uninitialized attribute _a2 (alt/base_attr_nullable_alt2.nit:39)
+Runtime error: Uninitialized attribute _a2 (alt/base_attr_nullable_alt2.nit:38)
1
-Runtime error: Uninitialized attribute _a1 (alt/base_attr_nullable_alt3.nit:64)
+Runtime error: Uninitialized attribute _a1 (alt/base_attr_nullable_alt3.nit:63)
-Runtime error: Uninitialized attribute _a2 (alt/base_attr_nullable_alt4.nit:45)
+Runtime error: Uninitialized attribute _a2 (alt/base_attr_nullable_alt4.nit:44)
10
-Runtime error: Uninitialized attribute _a3 (alt/base_attr_nullable_alt5.nit:66)
+Runtime error: Uninitialized attribute _a3 (alt/base_attr_nullable_alt5.nit:65)
10
20
-alt/base_init_basic_alt3.nit:47,7: Error: cannot generate automatic init for class F. Conflict in the order in inherited initializers base_init_basic_alt3$E$init(c=, e=) and base_init_basic_alt3$D$init(c=, b=). Use `autoinit` to order initializers. eg `autoinit c=, b=, e=`
-alt/base_init_basic_alt3.nit:54,7: Error: cannot generate automatic init for class G. Conflict in the order in inherited initializers base_init_basic_alt3$E$init(c=, e=) and base_init_basic_alt3$D$init(c=, b=). Use `autoinit` to order initializers. eg `autoinit c=, b=, e=, g=`
+alt/base_init_basic_alt3.nit:47,7: Error: cannot generate automatic init for class F. Conflict in the order in inherited initializers base_init_basic_alt3$E$defaultinit(c=, e=) and base_init_basic_alt3$D$defaultinit(c=, b=). Use `autoinit` to order initializers. eg `autoinit c=, b=, e=`
+alt/base_init_basic_alt3.nit:54,7: Error: cannot generate automatic init for class G. Conflict in the order in inherited initializers base_init_basic_alt3$E$defaultinit(c=, e=) and base_init_basic_alt3$D$defaultinit(c=, b=). Use `autoinit` to order initializers. eg `autoinit c=, b=, e=, g=`
-alt/base_init_basic_alt5.nit:79,9--11: Error: expected 2 argument(s) for `init(c, b: Int)`; got 1. See introduction at `core::Object::init`.
+alt/base_init_basic_alt5.nit:79,9--11: Error: expected 2 argument(s) for `defaultinit(c, b: Int)`; got 1. See introduction at `base_init_basic_alt5::D::defaultinit`.
-alt/base_init_combine_alt1.nit:59,9--11: Error: expected 2 argument(s) for `init(i, z: Int)`; got 1. See introduction at `core::Object::init`.
+alt/base_init_combine_alt1.nit:59,9--11: Error: expected 2 argument(s) for `defaultinit(i, z: Int)`; got 1. See introduction at `base_init_combine_alt1::F::defaultinit`.
-alt/base_init_noinit_alt4.nit:30,3--5: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
+alt/base_init_noinit_alt4.nit:30,3--5: Error: expected 0 argument(s) for `defaultinit`; got 1. See introduction at `base_init_noinit_alt4::A::defaultinit`.
-alt/base_init_super_call2_alt3.nit:38,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt3$A$init(i: Int)`. Expected at least `1` arguments.
+alt/base_init_super_call2_alt3.nit:38,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt3$A$defaultinit(i: Int)`. Expected at least `1` arguments.
-alt/base_init_super_call2_alt4.nit:60,3--7: Type Error: expected argument #0 of type `Int`, got implicit argument `j` of type `Bool`. Signature is (i: Int)
+alt/base_init_super_call2_alt4.nit:69,3--7: Type Error: expected argument #0 of type `Int`, got implicit argument `j` of type `Bool`. Signature is (i: Int)
-alt/base_init_super_call2_alt5.nit:84,9: Type Error: expected `Int`, got `Bool`.
+alt/base_init_super_call2_alt5.nit:102,9: Type Error: expected `Int`, got `Bool`.
-alt/base_init_super_call2_alt6.nit:91,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6$A$init(i: Int)`. Expected at least `1` arguments.
-alt/base_init_super_call2_alt6.nit:99,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6$A$init(i: Int)`. Expected at least `1` arguments.
-alt/base_init_super_call2_alt6.nit:107,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6$A$init(i: Int)`. Expected at least `1` arguments.
-alt/base_init_super_call2_alt6.nit:123,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6$A$init(i: Int)`. Expected at least `1` arguments.
+alt/base_init_super_call2_alt6.nit:131,2--5: Type Error: expected argument #0 of type `Int`, got implicit argument `i` of type `Bool`. Signature is (i: Int)
-1
-2
-3
-4
-6
-6
-7
-7
-8
-true
-9
-9
-10
-10
-11
-true
-12
-13
-14
-true
-15
-15
-16
+alt/base_init_super_call_alt3.nit:38,2--5: Error: cannot do an implicit constructor call to `base_init_super_call_alt3$A$defaultinit(i: Int)`. Expected at least `1` arguments.
+alt/base_new_alt8.nit:91,2--4: Error: ambiguous property name `defaultinit` for `Int`; conflict between core::Numeric::defaultinit and core::Discrete::defaultinit.
alt/base_new_alt8.nit:91,2--8: Type Error: cannot instantiate enum `Int`.
--- /dev/null
+b.a.x: 10
+100
+null
+10
+null
--- /dev/null
+Runtime error: Receiver is null (alt/base_safe2_alt1.nit:39)
-alt/base_vararg_mult_alt1.nit:40,5--7: Error: expected at least 1 argument(s) for `init(ints: Int...)`; got 0. See introduction at `core::Object::init`.
-alt/base_vararg_mult_alt1.nit:47,5--7: Error: expected 2 argument(s) for `init(ints: Int..., objs: Object...)`; got 3. See introduction at `core::Object::init`.
+alt/base_vararg_mult_alt1.nit:40,5--7: Error: expected at least 1 argument(s) for `defaultinit(ints: Int...)`; got 0. See introduction at `base_vararg_mult_alt1::A::defaultinit`.
+alt/base_vararg_mult_alt1.nit:47,5--7: Error: expected 2 argument(s) for `defaultinit(ints: Int..., objs: Object...)`; got 3. See introduction at `base_vararg_mult_alt1::B::defaultinit`.
alt/base_vararg_mult_alt1.nit:48,11--18: Type Error: expected `Int`, got `Array[Int]`. Is an ellipsis `...` missing on the argument?
-Runtime error: Assert 'expects' failed (contracts.nit:31)
+Runtime error: Assert 'expect(not bool)' failed (contracts.nit:31)
-Runtime error: Assert 'ensures' failed (contracts_abstract.nit:26)
+Runtime error: Assert 'ensure(y <= 10.0, y == 42.0)' failed (contracts_abstract.nit:26)
-contracts_add.nit:46,3--17: Useless contract: No contract defined at the introduction of the method
-Runtime error: Assert 'ensures' failed (contracts_add.nit:39)
+contracts_add.nit:46,3--16: Useless contract: No contract defined at the introduction of the method
+Runtime error: Assert 'ensure(x == 0)' failed (contracts_add.nit:39)
-Runtime error: Assert 'expects' failed (contracts_constructor.nit:20)
+Runtime error: Assert 'expect(test > 10)' failed (contracts_constructor.nit:20)
-Runtime error: Assert 'ensures' failed (contracts_ensures.nit:29)
+Runtime error: Assert 'ensure(not bool)' failed (contracts_ensures.nit:29)
-Runtime error: Assert 'ensures' failed (contracts_ensures_1.nit:20)
+Runtime error: Assert 'ensure(x > 0)' failed (contracts_ensures_1.nit:20)
Good
Fail
-Runtime error: Assert 'ensures' failed (contracts_ensures_2.nit:31)
+Runtime error: Assert 'ensure(y == 1.2)' failed (contracts_ensures_2.nit:31)
Good
Good
Good
-Runtime error: Assert 'ensures' failed (contracts_ensures_3.nit:20)
+Runtime error: Assert 'ensure(result > 0)' failed (contracts_ensures_3.nit:20)
-Runtime error: Assert 'ensures' failed (contracts_ensures_4.nit:31)
+Runtime error: Assert 'ensure(not result)' failed (contracts_ensures_4.nit:31)
-Runtime error: Assert 'ensures' failed (contracts_ensures_5.nit:29)
+Runtime error: Assert 'ensure' failed (contracts_ensures_5.nit:29)
-Runtime error: Assert 'ensures' failed (contracts_ensures_sequence.nit:18)
+Runtime error: Assert 'ensure(x > 2)' failed (contracts_ensures_sequence.nit:18)
-contracts_error.nit:23,11--23: Error: expected an expression.
-contracts_error.nit:24,11--23: Error: expected an expression.
+contracts_error.nit:23,3--23: Error: expected an expression.
+contracts_error.nit:24,3--23: Error: expected an expression.
-Runtime error: Assert 'expects' failed (contracts_expects_1.nit:20)
+Runtime error: Assert 'expect(x > 0)' failed (contracts_expects_1.nit:20)
-contracts_expects_3.nit:29,3--17: Useless contract: No contract defined at the introduction of the method
+contracts_expects_3.nit:29,3--16: Useless contract: No contract defined at the introduction of the method
Good
Good
-Runtime error: Assert 'expects' failed (contracts_generic_type.nit:33)
+Runtime error: Assert 'expect(x.length != 0)' failed (contracts_generic_type.nit:33)
contracts_inheritance.nit:58,6--9: Warning: conflicting property definitions for property `toto` in `MySubArray`: contracts_inheritance$MyArrayInt$toto contracts_inheritance$MyArrayInt2$toto
-Runtime error: Assert 'ensures' failed (contracts_inheritance.nit:32)
+Runtime error: Assert 'ensure(e == 12)' failed (contracts_inheritance.nit:32)
toto MyArrayInt2
toto MyArrayInt
toto ArrayInt
-contracts_same_contract.nit:22,3--18: The method already has a defined `expects` contract at line 21
--- /dev/null
+Runtime error: Assert 'ensure(x > 10)' failed (contracts_static.nit:29)
+Error
-Runtime error: Assert 'expects' failed (contracts_virtual_type.nit:23)
+Runtime error: Assert 'expect(x == 1)' failed (contracts_virtual_type.nit:23)
background-color: #f0f0f2;
margin: 0;
padding: 0;
- font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
- padding: 50px;
- background-color: #fff;
- border-radius: 1em;
+ padding: 2em;
+ background-color: #fdfdff;
+ border-radius: 0.5em;
+ box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
- body {
- background-color: #fff;
- }
div {
- width: auto;
margin: 0 auto;
- border-radius: 0;
- padding: 1em;
+ width: auto;
}
}
</style>
<body>
<div>
<h1>Example Domain</h1>
- <p>This domain is established to be used for illustrative examples in documents. You may use this
- domain in examples without prior coordination or asking for permission.</p>
- <p><a href="http://www.iana.org/domains/example">More information...</a></p>
+ <p>This domain is for use in illustrative examples in documents. You may use this
+ domain in literature without prior coordination or asking for permission.</p>
+ <p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
background-color: #f0f0f2;
margin: 0;
padding: 0;
- font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
- padding: 50px;
- background-color: #fff;
- border-radius: 1em;
+ padding: 2em;
+ background-color: #fdfdff;
+ border-radius: 0.5em;
+ box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
- body {
- background-color: #fff;
- }
div {
- width: auto;
margin: 0 auto;
- border-radius: 0;
- padding: 1em;
+ width: auto;
}
}
</style>
<body>
<div>
<h1>Example Domain</h1>
- <p>This domain is established to be used for illustrative examples in documents. You may use this
- domain in examples without prior coordination or asking for permission.</p>
- <p><a href="http://www.iana.org/domains/example">More information...</a></p>
+ <p>This domain is for use in illustrative examples in documents. You may use this
+ domain in literature without prior coordination or asking for permission.</p>
+ <p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
*** Answer ***
Status code: 200
-Size downloaded: 1270.0
+Size downloaded: 1256.0
-../lib/core/kernel.nit:32,1--225,3: Error: `kernel$Object` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:227,1--300,3: Error: `kernel$Sys` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:313,1--371,3: Error: `kernel$Comparable` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:373,1--410,3: Error: `kernel$Discrete` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:412,1--429,3: Error: `kernel$Cloneable` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:431,1--486,3: Error: `kernel$Numeric` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:492,1--515,3: Error: `kernel$Bool` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:517,1--599,3: Error: `kernel$Float` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:601,1--700,3: Error: `kernel$Byte` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:702,1--886,3: Error: `kernel$Int` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:888,1--1067,3: Error: `kernel$Char` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:1069,1--1086,3: Error: `kernel$Pointer` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:1088,1--1097,3: Error: `kernel$Task` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/collection/hash_collection.nit:275,3--6: Possible duplication of the root class `Object`
+../lib/core/collection/hash_collection.nit:473,3--6: Possible duplication of the root class `Object`
-alt/error_defs_init_1alt1_alt2.nit:27,2--5: Error: a property `init` is already defined in class `A` at line 18.
-alt/error_defs_init_1alt2_alt1.nit:26,2--5: Error: a property `init` is already defined in class `A` at line 18.
-alt/error_defs_init_1alt2_alt2.nit:27,2--5: Error: a property `init` is already defined in class `A` at line 18.
+alt/error_defs_init_1alt2_alt2.nit:27,2--5: Error: a property `defaultinit` is already defined in class `A` at line 18.
-error_init_auto.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `core::Object::init`.
-error_init_auto.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `core::Object::init`.
-error_init_auto.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `core::Object::init`.
+error_init_auto.nit:34,5--7: Error: expected 1 argument(s) for `defaultinit(x: Int)`; got 0. See introduction at `error_init_auto::A::defaultinit`.
+error_init_auto.nit:36,5--7: Error: expected 1 argument(s) for `defaultinit(x: Int)`; got 2. See introduction at `error_init_auto::A::defaultinit`.
+error_init_auto.nit:37,5--7: Error: expected 1 argument(s) for `defaultinit(x: Int)`; got 3. See introduction at `error_init_auto::A::defaultinit`.
error_init_auto.nit:38,11--13: Error: method `foo` does not exists in `A`.
-alt/error_init_auto_alt1.nit:35,5--7: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
-alt/error_init_auto_alt1.nit:36,5--7: Error: expected 0 argument(s) for `init`; got 2. See introduction at `core::Object::init`.
-alt/error_init_auto_alt1.nit:37,5--7: Error: expected 0 argument(s) for `init`; got 3. See introduction at `core::Object::init`.
+alt/error_init_auto_alt1.nit:35,5--7: Error: expected 0 argument(s) for `defaultinit`; got 1. See introduction at `error_init_auto_alt1::A::defaultinit`.
+alt/error_init_auto_alt1.nit:36,5--7: Error: expected 0 argument(s) for `defaultinit`; got 2. See introduction at `error_init_auto_alt1::A::defaultinit`.
+alt/error_init_auto_alt1.nit:37,5--7: Error: expected 0 argument(s) for `defaultinit`; got 3. See introduction at `error_init_auto_alt1::A::defaultinit`.
alt/error_init_auto_alt1.nit:38,11--13: Error: method `foo` does not exists in `A`.
-alt/error_init_auto_alt2.nit:34,5--7: Error: expected 2 argument(s) for `init(x, y: Int)`; got 0. See introduction at `core::Object::init`.
-alt/error_init_auto_alt2.nit:35,5--7: Error: expected 2 argument(s) for `init(x, y: Int)`; got 1. See introduction at `core::Object::init`.
-alt/error_init_auto_alt2.nit:37,5--7: Error: expected 2 argument(s) for `init(x, y: Int)`; got 3. See introduction at `core::Object::init`.
+alt/error_init_auto_alt2.nit:34,5--7: Error: expected 2 argument(s) for `defaultinit(x, y: Int)`; got 0. See introduction at `error_init_auto_alt2::A::defaultinit`.
+alt/error_init_auto_alt2.nit:35,5--7: Error: expected 2 argument(s) for `defaultinit(x, y: Int)`; got 1. See introduction at `error_init_auto_alt2::A::defaultinit`.
+alt/error_init_auto_alt2.nit:37,5--7: Error: expected 2 argument(s) for `defaultinit(x, y: Int)`; got 3. See introduction at `error_init_auto_alt2::A::defaultinit`.
alt/error_init_auto_alt2.nit:38,11--13: Error: method `foo` does not exists in `A`.
-alt/error_init_auto_alt3.nit:34,5--7: Error: expected 1 argument(s) for `init(xx: Int)`; got 0. See introduction at `error_init_auto_alt3::A::init`.
-alt/error_init_auto_alt3.nit:36,5--7: Error: expected 1 argument(s) for `init(xx: Int)`; got 2. See introduction at `error_init_auto_alt3::A::init`.
-alt/error_init_auto_alt3.nit:37,5--7: Error: expected 1 argument(s) for `init(xx: Int)`; got 3. See introduction at `error_init_auto_alt3::A::init`.
+alt/error_init_auto_alt3.nit:34,5--7: Error: expected 1 argument(s) for `defaultinit(xx: Int)`; got 0. See introduction at `error_init_auto_alt3::A::defaultinit`.
+alt/error_init_auto_alt3.nit:36,5--7: Error: expected 1 argument(s) for `defaultinit(xx: Int)`; got 2. See introduction at `error_init_auto_alt3::A::defaultinit`.
+alt/error_init_auto_alt3.nit:37,5--7: Error: expected 1 argument(s) for `defaultinit(xx: Int)`; got 3. See introduction at `error_init_auto_alt3::A::defaultinit`.
alt/error_init_auto_alt3.nit:38,11--13: Error: method `foo` does not exists in `A`.
-alt/error_init_auto_alt4.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `core::Object::init`.
-alt/error_init_auto_alt4.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `core::Object::init`.
-alt/error_init_auto_alt4.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `core::Object::init`.
+alt/error_init_auto_alt4.nit:34,5--7: Error: expected 1 argument(s) for `defaultinit(x: Int)`; got 0. See introduction at `error_init_auto_alt4::A::defaultinit`.
+alt/error_init_auto_alt4.nit:36,5--7: Error: expected 1 argument(s) for `defaultinit(x: Int)`; got 2. See introduction at `error_init_auto_alt4::A::defaultinit`.
+alt/error_init_auto_alt4.nit:37,5--7: Error: expected 1 argument(s) for `defaultinit(x: Int)`; got 3. See introduction at `error_init_auto_alt4::A::defaultinit`.
\e[0;33mtest_keep_going.nit:44,18--21\e[0m: Error: method `fail` does not exists in `Sys`.
var a = new Sys.\e[1;31mfail\e[0m
^
+Errors: 6. Warnings: 0.
1
2
3
</ul>
<h3>Quality</h3>
<ul class="box">
-<li>28 warnings (55/kloc)</li>
+<li>26 warnings (51/kloc)</li>
<li>73% documented</li>
</ul>
<h3>Tags</h3>
<ul class="box">
<li>10 modules</li>
<li>26 classes</li>
-<li>79 methods</li>
+<li>101 methods</li>
<li>509 lines of code</li>
</ul>
</div>
Parsing code...
Generating documentation pages...
Documentation produced in `out/nitdoc_args1.write`
-Generated 22/22 pages
+Generated 27/27 pages
PageHome: 1
PageMPackage: 2
PageMGroup: 2
PageMModule: 2
PageMClass: 5
- PageMProperty: 10
+ PageMProperty: 15
PagePerson: 0
PageTag: 0
class_module_95d0_58d_58dInt.html
module_module_95d1_58d_58dmodule_95d1.html
package_module_95d0.html
package_module_95d1.html
+property_module_95d0_58d_58dInt_58d_58ddefaultinit.html
+property_module_95d0_58d_58dObject_58d_58ddefaultinit.html
property_module_95d0_58d_58dObject_58d_58dinit.html
property_module_95d0_58d_58dObject_58d_58doutput.html
property_module_95d0_58d_58dObject_58d_58dprint.html
+property_module_95d0_58d_58dSys_58d_58ddefaultinit.html
property_module_95d0_58d_58dSys_58d_58dmain.html
property_module_95d1_58d_58dA_58d_58da1.html
property_module_95d1_58d_58dA_58d_58da12.html
property_module_95d1_58d_58dA_58d_58da123.html
property_module_95d1_58d_58dA_58d_58da13.html
+property_module_95d1_58d_58dA_58d_58ddefaultinit.html
property_module_95d1_58d_58dB_58d_58dall2.html
property_module_95d1_58d_58dB_58d_58dall25.html
+property_module_95d1_58d_58dB_58d_58ddefaultinit.html
quicksearch-list.js
vendors/
Parsing code...
Generating documentation pages...
Documentation produced in `out/nitdoc_args2.write`
-Generated 28/28 pages
+Generated 31/31 pages
PageHome: 1
PageMPackage: 1
PageMGroup: 1
PageMModule: 1
PageMClass: 7
- PageMProperty: 17
+ PageMProperty: 20
PagePerson: 0
PageTag: 0
class_base_attr_nullable_58d_58dBar.html
package_base_attr_nullable.html
property_base_attr_nullable_58d_58dBar_58d_58da3.html
property_base_attr_nullable_58d_58dBar_58d_58da3_61d.html
+property_base_attr_nullable_58d_58dBar_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dFoo_58d_58da1.html
property_base_attr_nullable_58d_58dFoo_58d_58da1_61d.html
property_base_attr_nullable_58d_58dFoo_58d_58da2.html
property_base_attr_nullable_58d_58dFoo_58d_58da2_61d.html
+property_base_attr_nullable_58d_58dFoo_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dFoo_58d_58dnop.html
property_base_attr_nullable_58d_58dFoo_58d_58drun.html
property_base_attr_nullable_58d_58dFoo_58d_58drun_other.html
property_base_attr_nullable_58d_58dInt_58d_58d_43d.html
property_base_attr_nullable_58d_58dInt_58d_58doutput.html
-property_base_attr_nullable_58d_58dInteger_58d_58dinit.html
+property_base_attr_nullable_58d_58dInteger_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dInteger_58d_58doutput.html
property_base_attr_nullable_58d_58dInteger_58d_58dval.html
property_base_attr_nullable_58d_58dInteger_58d_58dval_61d.html
+property_base_attr_nullable_58d_58dObject_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dObject_58d_58dinit.html
property_base_attr_nullable_58d_58dSys_58d_58dmain.html
quicksearch-list.js
Parsing code...
Generating documentation pages...
Documentation produced in `out/nitdoc_args3.write`
-Generated 28/28 pages
+Generated 31/31 pages
PageHome: 1
PageMPackage: 1
PageMGroup: 1
PageMModule: 1
PageMClass: 7
- PageMProperty: 17
+ PageMProperty: 20
PagePerson: 0
PageTag: 0
class_base_attr_nullable_58d_58dBar.html
package_base_attr_nullable.html
property_base_attr_nullable_58d_58dBar_58d_58da3.html
property_base_attr_nullable_58d_58dBar_58d_58da3_61d.html
+property_base_attr_nullable_58d_58dBar_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dFoo_58d_58da1.html
property_base_attr_nullable_58d_58dFoo_58d_58da1_61d.html
property_base_attr_nullable_58d_58dFoo_58d_58da2.html
property_base_attr_nullable_58d_58dFoo_58d_58da2_61d.html
+property_base_attr_nullable_58d_58dFoo_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dFoo_58d_58dnop.html
property_base_attr_nullable_58d_58dFoo_58d_58drun.html
property_base_attr_nullable_58d_58dFoo_58d_58drun_other.html
property_base_attr_nullable_58d_58dInt_58d_58d_43d.html
property_base_attr_nullable_58d_58dInt_58d_58doutput.html
-property_base_attr_nullable_58d_58dInteger_58d_58dinit.html
+property_base_attr_nullable_58d_58dInteger_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dInteger_58d_58doutput.html
property_base_attr_nullable_58d_58dInteger_58d_58dval.html
property_base_attr_nullable_58d_58dInteger_58d_58dval_61d.html
+property_base_attr_nullable_58d_58dObject_58d_58ddefaultinit.html
property_base_attr_nullable_58d_58dObject_58d_58dinit.html
property_base_attr_nullable_58d_58dSys_58d_58dmain.html
quicksearch-list.js
Parsing code...
Generating documentation pages...
-Generated 111/111 pages
+Generated 134/134 pages
PageHome: 1
PageMPackage: 2
PageMGroup: 7
PageMModule: 10
PageMClass: 22
- PageMProperty: 61
+ PageMProperty: 84
PagePerson: 6
PageTag: 2
</span></span><span class="line" id="L33">
</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class B" data-title="<a href="#base_simple3$B">class B</a>" data-content="<div><b>class</b> <span>B</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">B</span>
</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3$B$val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
-</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L39"> <span class="nc_k popupable" title="B" data-title="<a href="#base_simple3$B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
-</span><span class="line" id="L40"> <span class="nc_k">end</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3$B$val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val">base_simple3$B$val</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="line" id="L42"><span class="nc_k">end</span>
-</span></span><span class="line" id="L43">
-</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3$C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
-</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
-</span></span><span class="line" id="L47"><span class="nc_k">end</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L37"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3$B$val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val">base_simple3$B$val</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="line" id="L38"><span class="nc_k">end</span>
+</span></span><span class="line" id="L39">
+</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L40"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3$C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
+</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L41"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L42"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
+</span></span><span class="line" id="L43"><span class="nc_k">end</span>
+</span></span><span class="line" id="L44">
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L45"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L46"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L47"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
</span></span><span class="line" id="L48">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
-</span></span><span class="line" id="L52">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
-</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$init" data-title="<a href="#base_simple3$A$init">call base_simple3$A$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$init">base_simple3$A$init</a><span></span></span><br/><b>intro</b> <span><a href="#base_simple3$Object$init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3$A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
-</span><span class="line" id="L59"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$init" data-title="<a href="#base_simple3$B$init">call base_simple3$B$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$init">base_simple3$B$init</a><span>(v: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3$B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$init" data-title="<a href="#base_simple3$C$init">call base_simple3$C$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$init">base_simple3$C$init</a><span>(val1: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/><b>intro</b> <span><a href="#base_simple3$Object$init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3$C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L66"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L49"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L50"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L51"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L52"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L53">
+</span><span class="line" id="L54"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$defaultinit" data-title="<a href="#base_simple3$A$defaultinit">call base_simple3$A$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$defaultinit">base_simple3$A$defaultinit</a><span></span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3$A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L55"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L56">
+</span><span class="line" id="L57"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$defaultinit" data-title="<a href="#base_simple3$B$defaultinit">call base_simple3$B$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$defaultinit">base_simple3$B$defaultinit</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3$B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L58"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L59">
+</span><span class="line" id="L60"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$defaultinit" data-title="<a href="#base_simple3$C$defaultinit">call base_simple3$C$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$defaultinit">base_simple3$C$defaultinit</a><span>(val1: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3$C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L61"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span></span>
\ No newline at end of file
</span></span><span class="line" id="L33">
</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class B" data-title="<a href="#base_simple3$B">class B</a>" data-content="<div><b>class</b> <span>B</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">B</span>
</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3$B$val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
-</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L39"> <span class="nc_k popupable" title="B" data-title="<a href="#base_simple3$B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
-</span><span class="line" id="L40"> <span class="nc_k">end</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3$B$val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val">base_simple3$B$val</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="line" id="L42"><span class="nc_k">end</span>
-</span></span><span class="line" id="L43">
-</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3$C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
-</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
-</span></span><span class="line" id="L47"><span class="nc_k">end</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L37"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3$B$val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val">base_simple3$B$val</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="line" id="L38"><span class="nc_k">end</span>
+</span></span><span class="line" id="L39">
+</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L40"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3$C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
+</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L41"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L42"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
+</span></span><span class="line" id="L43"><span class="nc_k">end</span>
+</span></span><span class="line" id="L44">
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L45"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L46"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L47"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
</span></span><span class="line" id="L48">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
-</span></span><span class="line" id="L52">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
-</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$init" data-title="<a href="#base_simple3$A$init">call base_simple3$A$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$init">base_simple3$A$init</a><span></span></span><br/><b>intro</b> <span><a href="#base_simple3$Object$init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3$A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
-</span><span class="line" id="L59"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$init" data-title="<a href="#base_simple3$B$init">call base_simple3$B$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$init">base_simple3$B$init</a><span>(v: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3$B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$init" data-title="<a href="#base_simple3$C$init">call base_simple3$C$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$init">base_simple3$C$init</a><span>(val1: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/><b>intro</b> <span><a href="#base_simple3$Object$init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3$C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L66"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L49"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L50"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L51"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L52"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L53">
+</span><span class="line" id="L54"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$defaultinit" data-title="<a href="#base_simple3$A$defaultinit">call base_simple3$A$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$defaultinit">base_simple3$A$defaultinit</a><span></span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3$A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L55"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L56">
+</span><span class="line" id="L57"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$defaultinit" data-title="<a href="#base_simple3$B$defaultinit">call base_simple3$B$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$defaultinit">base_simple3$B$defaultinit</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3$B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L58"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L59">
+</span><span class="line" id="L60"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$defaultinit" data-title="<a href="#base_simple3$C$defaultinit">call base_simple3$C$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$defaultinit">base_simple3$C$defaultinit</a><span>(val1: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3$C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L61"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span></span></pre><script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script>$(".popupable").popover({html:true, placement:'top'})/*initialize bootstrap popover*/</script></body></html>
\ No newline at end of file
-<span class="nitcode"><span class="line" id="XYZ38"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="XYZ39"> <span class="nc_k popupable" title="B" data-title="<a href="#base_simple3$B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
-</span><span class="line" id="XYZ40"> <span class="nc_k">end</span>
-</span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="XYZ41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3$B$val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val">base_simple3$B$val</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="line" id="XYZ42"><span class="nc_k">end</span>
-</span><span class="line" id="XYZ43">
-</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="XYZ44"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3$C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
-</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="XYZ45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="XYZ46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
-</span></span></span></span>
\ No newline at end of file
+<span class="nitcode"><span class="line" id="XYZ38"><span class="nc_k">end</span>
+</span><span class="line" id="XYZ39">
+</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="XYZ40"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3$C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
+</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="XYZ41"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="XYZ42"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
+</span></span><span class="line" id="XYZ43"><span class="nc_k">end</span>
+</span></span><span class="line" id="XYZ44">
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="XYZ45"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="XYZ46"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3$Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span></span>
\ No newline at end of file
class B
var val: Int
- init(v: Int)
- do
- 7.output
- self.val = v
- end
+ init do 7.output
fun run do val.output
end
</span></span><span class="line" id="L33">
</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <a class="titled" href="#base_simple3$B" title="class B"><span class="nc_t nc_def">B</span></a>
</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <a class="titled" href="#base_simple3$B$val" title="base_simple3$B$val"><span class="nc_i nc_def">val</span></a><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v titled" title="v: Int">v</span><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a><span>)</span>
-</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">7</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
-</span><span class="line" id="L39"> <a class="titled" href="#base_simple3$B" title="B"><span class="nc_k">self</span></a><a class="titled" href="#base_simple3$B$val=" title="call base_simple3$B$val="><span>.</span></a><a class="titled" href="#base_simple3$B$val=" title="call base_simple3$B$val="><span class="nc_i">val</span></a> <a class="titled" href="#base_simple3$B$val=" title="call base_simple3$B$val="><span>=</span></a> <span class="nc_i nc_v titled" title="v: Int">v</span>
-</span><span class="line" id="L40"> <span class="nc_k">end</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <a class="titled" href="#base_simple3$B$run" title="base_simple3$B$run"><span class="nc_def"></span><span class="nc_i">run</span></a> <span class="nc_k">do</span> <a class="titled" href="#base_simple3$B$val" title="call base_simple3$B$val"><span class="nc_i">val</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
-</span></span><span class="line" id="L42"><span class="nc_k">end</span>
-</span></span><span class="line" id="L43">
-</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <a class="titled" href="#base_simple3$C" title="class C"><span class="nc_t nc_def">C</span></a>
-</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <a class="titled" href="#base_simple3$C$val1" title="base_simple3$C$val1"><span class="nc_i nc_def">val1</span></a><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a>
-</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <a class="titled" href="#base_simple3$C$val2" title="base_simple3$C$val2"><span class="nc_i nc_def">val2</span></a><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a> <span>=</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">10</span></a>
-</span></span><span class="line" id="L47"><span class="nc_k">end</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k">init</span> <span class="nc_k">do</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">7</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L37"> <span class="nc_k">fun</span> <a class="titled" href="#base_simple3$B$run" title="base_simple3$B$run"><span class="nc_def"></span><span class="nc_i">run</span></a> <span class="nc_k">do</span> <a class="titled" href="#base_simple3$B$val" title="call base_simple3$B$val"><span class="nc_i">val</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span></span><span class="line" id="L38"><span class="nc_k">end</span>
+</span></span><span class="line" id="L39">
+</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L40"><span class="nc_k">class</span> <a class="titled" href="#base_simple3$C" title="class C"><span class="nc_t nc_def">C</span></a>
+</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L41"> <span class="nc_k">var</span> <a class="titled" href="#base_simple3$C$val1" title="base_simple3$C$val1"><span class="nc_i nc_def">val1</span></a><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a>
+</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L42"> <span class="nc_k">var</span> <a class="titled" href="#base_simple3$C$val2" title="base_simple3$C$val2"><span class="nc_i nc_def">val2</span></a><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a> <span>=</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">10</span></a>
+</span></span><span class="line" id="L43"><span class="nc_k">end</span>
+</span></span><span class="line" id="L44">
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L45"><span class="nc_k">fun</span> <a class="titled" href="#base_simple3$Sys$foo" title="base_simple3$Sys$foo"><span class="nc_def"></span><span class="nc_i">foo</span></a> <span class="nc_k">do</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">2</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L46"><span class="nc_k">fun</span> <a class="titled" href="#base_simple3$Sys$bar" title="base_simple3$Sys$bar"><span class="nc_def"></span><span class="nc_i">bar</span></a><span>(</span><span class="nc_i nc_v titled" title="i: Int">i</span><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v titled" title="i: Int">i</span><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L47"><span class="nc_k">fun</span> <a class="titled" href="#base_simple3$Sys$baz" title="base_simple3$Sys$baz"><span class="nc_def"></span><span class="nc_i">baz</span></a><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a> <span class="nc_k">do</span> <span class="nc_k">return</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">4</span></a>
</span></span><span class="line" id="L48">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <a class="titled" href="#base_simple3$Sys$foo" title="base_simple3$Sys$foo"><span class="nc_def"></span><span class="nc_i">foo</span></a> <span class="nc_k">do</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">2</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <a class="titled" href="#base_simple3$Sys$bar" title="base_simple3$Sys$bar"><span class="nc_def"></span><span class="nc_i">bar</span></a><span>(</span><span class="nc_i nc_v titled" title="i: Int">i</span><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v titled" title="i: Int">i</span><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <a class="titled" href="#base_simple3$Sys$baz" title="base_simple3$Sys$baz"><span class="nc_def"></span><span class="nc_i">baz</span></a><span>:</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_t">Int</span></a> <span class="nc_k">do</span> <span class="nc_k">return</span> <a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">4</span></a>
-</span></span><span class="line" id="L52">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">1</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
-</span><span class="line" id="L54"><a class="titled" href="#base_simple3$Sys$foo" title="call base_simple3$Sys$foo"><span class="nc_i">foo</span></a>
-</span><span class="line" id="L55"><a class="titled" href="#base_simple3$Sys$bar" title="call base_simple3$Sys$bar"><span class="nc_i">bar</span></a><span>(</span><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">3</span></a><span>)</span>
-</span><span class="line" id="L56"><a class="titled" href="#base_simple3$Sys$baz" title="call base_simple3$Sys$baz"><span class="nc_i">baz</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
-</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v titled" title="a: A">a</span> <span>=</span> <a class="titled" href="#base_simple3$A$init" title="call base_simple3$A$init"><span class="nc_k">new</span></a> <a class="titled" href="#base_simple3$A" title="A"><span class="nc_t">A</span></a>
-</span><span class="line" id="L59"><span class="nc_i nc_v titled" title="a: A">a</span><a class="titled" href="#base_simple3$A$run" title="call base_simple3$A$run"><span>.</span></a><a class="titled" href="#base_simple3$A$run" title="call base_simple3$A$run"><span class="nc_i">run</span></a>
-</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v titled" title="b: B">b</span> <span>=</span> <a class="titled" href="#base_simple3$B$init" title="call base_simple3$B$init"><span class="nc_k">new</span></a> <a class="titled" href="#base_simple3$B" title="B"><span class="nc_t">B</span></a><span>(</span><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">8</span></a><span>)</span>
-</span><span class="line" id="L62"><span class="nc_i nc_v titled" title="b: B">b</span><a class="titled" href="#base_simple3$B$run" title="call base_simple3$B$run"><span>.</span></a><a class="titled" href="#base_simple3$B$run" title="call base_simple3$B$run"><span class="nc_i">run</span></a>
-</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v titled" title="c: C">c</span> <span>=</span> <a class="titled" href="#base_simple3$C$init" title="call base_simple3$C$init"><span class="nc_k">new</span></a> <a class="titled" href="#base_simple3$C" title="C"><span class="nc_t">C</span></a><span>(</span><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">9</span></a><span>)</span>
-</span><span class="line" id="L65"><span class="nc_i nc_v titled" title="c: C">c</span><a class="titled" href="#base_simple3$C$val1" title="call base_simple3$C$val1"><span>.</span></a><a class="titled" href="#base_simple3$C$val1" title="call base_simple3$C$val1"><span class="nc_i">val1</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
-</span><span class="line" id="L66"><span class="nc_i nc_v titled" title="c: C">c</span><a class="titled" href="#base_simple3$C$val2" title="call base_simple3$C$val2"><span>.</span></a><a class="titled" href="#base_simple3$C$val2" title="call base_simple3$C$val2"><span class="nc_i">val2</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L49"><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">1</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span><span class="line" id="L50"><a class="titled" href="#base_simple3$Sys$foo" title="call base_simple3$Sys$foo"><span class="nc_i">foo</span></a>
+</span><span class="line" id="L51"><a class="titled" href="#base_simple3$Sys$bar" title="call base_simple3$Sys$bar"><span class="nc_i">bar</span></a><span>(</span><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">3</span></a><span>)</span>
+</span><span class="line" id="L52"><a class="titled" href="#base_simple3$Sys$baz" title="call base_simple3$Sys$baz"><span class="nc_i">baz</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span><span class="line" id="L53">
+</span><span class="line" id="L54"><span class="nc_k">var</span> <span class="nc_i nc_v titled" title="a: A">a</span> <span>=</span> <a class="titled" href="#base_simple3$A$defaultinit" title="call base_simple3$A$defaultinit"><span class="nc_k">new</span></a> <a class="titled" href="#base_simple3$A" title="A"><span class="nc_t">A</span></a>
+</span><span class="line" id="L55"><span class="nc_i nc_v titled" title="a: A">a</span><a class="titled" href="#base_simple3$A$run" title="call base_simple3$A$run"><span>.</span></a><a class="titled" href="#base_simple3$A$run" title="call base_simple3$A$run"><span class="nc_i">run</span></a>
+</span><span class="line" id="L56">
+</span><span class="line" id="L57"><span class="nc_k">var</span> <span class="nc_i nc_v titled" title="b: B">b</span> <span>=</span> <a class="titled" href="#base_simple3$B$defaultinit" title="call base_simple3$B$defaultinit"><span class="nc_k">new</span></a> <a class="titled" href="#base_simple3$B" title="B"><span class="nc_t">B</span></a><span>(</span><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">8</span></a><span>)</span>
+</span><span class="line" id="L58"><span class="nc_i nc_v titled" title="b: B">b</span><a class="titled" href="#base_simple3$B$run" title="call base_simple3$B$run"><span>.</span></a><a class="titled" href="#base_simple3$B$run" title="call base_simple3$B$run"><span class="nc_i">run</span></a>
+</span><span class="line" id="L59">
+</span><span class="line" id="L60"><span class="nc_k">var</span> <span class="nc_i nc_v titled" title="c: C">c</span> <span>=</span> <a class="titled" href="#base_simple3$C$defaultinit" title="call base_simple3$C$defaultinit"><span class="nc_k">new</span></a> <a class="titled" href="#base_simple3$C" title="C"><span class="nc_t">C</span></a><span>(</span><a class="titled" href="#base_simple3$Int" title="Int"><span class="nc_l">9</span></a><span>)</span>
+</span><span class="line" id="L61"><span class="nc_i nc_v titled" title="c: C">c</span><a class="titled" href="#base_simple3$C$val1" title="call base_simple3$C$val1"><span>.</span></a><a class="titled" href="#base_simple3$C$val1" title="call base_simple3$C$val1"><span class="nc_i">val1</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
+</span><span class="line" id="L62"><span class="nc_i nc_v titled" title="c: C">c</span><a class="titled" href="#base_simple3$C$val2" title="call base_simple3$C$val2"><span>.</span></a><a class="titled" href="#base_simple3$C$val2" title="call base_simple3$C$val2"><span class="nc_i">val2</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span>.</span></a><a class="titled" href="#base_simple3$Int$output" title="call base_simple3$Int$output"><span class="nc_i">output</span></a>
</span></span></span></pre><script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script>$(".popupable").popover({html:true, placement:'top'})/*initialize bootstrap popover*/</script></body></html>
\ No newline at end of file
*** METRICS ***
--- AST Metrics ---
## All nodes of the AST
- population: 52
+ population: 49
minimum value: 1
- maximum value: 40
- total value: 304
- average value: 5.84
+ maximum value: 37
+ total value: 286
+ average value: 5.83
distribution:
- <=1: sub-population=16 (30.76%); cumulated value=16 (5.26%)
- <=2: sub-population=5 (9.61%); cumulated value=10 (3.28%)
- <=4: sub-population=9 (17.30%); cumulated value=28 (9.21%)
- <=8: sub-population=12 (23.07%); cumulated value=76 (25.00%)
- <=16: sub-population=5 (9.61%); cumulated value=59 (19.40%)
- <=32: sub-population=4 (7.69%); cumulated value=75 (24.67%)
- <=64: sub-population=1 (1.92%); cumulated value=40 (13.15%)
+ <=1: sub-population=15 (30.61%); cumulated value=15 (5.24%)
+ <=2: sub-population=3 (6.12%); cumulated value=6 (2.09%)
+ <=4: sub-population=12 (24.48%); cumulated value=40 (13.98%)
+ <=8: sub-population=10 (20.40%); cumulated value=67 (23.42%)
+ <=16: sub-population=4 (8.16%); cumulated value=48 (16.78%)
+ <=32: sub-population=4 (8.16%); cumulated value=73 (25.52%)
+ <=64: sub-population=1 (2.04%); cumulated value=37 (12.93%)
list:
- TId: 40 (13.15%)
- APublicVisibility: 19 (6.25%)
- AListExprs: 19 (6.25%)
- AQid: 19 (6.25%)
- ACallExpr: 18 (5.92%)
- TClassid: 15 (4.93%)
- AQclassid: 15 (4.93%)
- TInteger: 10 (3.28%)
- AIntegerExpr: 10 (3.28%)
- AType: 9 (2.96%)
+ TId: 37 (12.93%)
+ APublicVisibility: 19 (6.64%)
+ ACallExpr: 18 (6.29%)
+ AQid: 18 (6.29%)
+ AListExprs: 18 (6.29%)
+ AQclassid: 14 (4.89%)
+ TClassid: 14 (4.89%)
+ TInteger: 10 (3.49%)
+ AIntegerExpr: 10 (3.49%)
+ ASignature: 8 (2.79%)
...
- AAnnotation: 1 (0.32%)
- AAnnotations: 1 (0.32%)
- AReturnExpr: 1 (0.32%)
- TKwreturn: 1 (0.32%)
- AInterfaceClasskind: 1 (0.32%)
- TKwinterface: 1 (0.32%)
- ANoImport: 1 (0.32%)
- AMainMethPropdef: 1 (0.32%)
- AMainClassdef: 1 (0.32%)
- TKwimport: 1 (0.32%)
+ TKwreturn: 1 (0.34%)
+ AAnnotation: 1 (0.34%)
+ AParam: 1 (0.34%)
+ AMainMethPropdef: 1 (0.34%)
+ AInterfaceClasskind: 1 (0.34%)
+ TKwinterface: 1 (0.34%)
+ ANoImport: 1 (0.34%)
+ ABlockExpr: 1 (0.34%)
+ AMainClassdef: 1 (0.34%)
+ TKwimport: 1 (0.34%)
## All identifiers of the AST
- population: 20
+ population: 19
minimum value: 1
maximum value: 11
- total value: 55
- average value: 2.75
+ total value: 51
+ average value: 2.68
distribution:
- <=1: sub-population=3 (15.00%); cumulated value=3 (5.45%)
- <=2: sub-population=12 (60.00%); cumulated value=24 (43.63%)
- <=4: sub-population=3 (15.00%); cumulated value=10 (18.18%)
- <=8: sub-population=1 (5.00%); cumulated value=7 (12.72%)
- <=16: sub-population=1 (5.00%); cumulated value=11 (20.00%)
+ <=1: sub-population=3 (15.78%); cumulated value=3 (5.88%)
+ <=2: sub-population=12 (63.15%); cumulated value=24 (47.05%)
+ <=4: sub-population=2 (10.52%); cumulated value=7 (13.72%)
+ <=8: sub-population=1 (5.26%); cumulated value=6 (11.76%)
+ <=16: sub-population=1 (5.26%); cumulated value=11 (21.56%)
list:
- output: 11 (20.00%)
- Int: 7 (12.72%)
- run: 4 (7.27%)
- c: 3 (5.45%)
- val: 3 (5.45%)
- i: 2 (3.63%)
- bar: 2 (3.63%)
- foo: 2 (3.63%)
- val2: 2 (3.63%)
- val1: 2 (3.63%)
- C: 2 (3.63%)
- v: 2 (3.63%)
- baz: 2 (3.63%)
- a: 2 (3.63%)
- A: 2 (3.63%)
- B: 2 (3.63%)
- b: 2 (3.63%)
- intern: 1 (1.81%)
- Object: 1 (1.81%)
- Bool: 1 (1.81%)
+ output: 11 (21.56%)
+ Int: 6 (11.76%)
+ run: 4 (7.84%)
+ c: 3 (5.88%)
+ baz: 2 (3.92%)
+ i: 2 (3.92%)
+ bar: 2 (3.92%)
+ val2: 2 (3.92%)
+ val1: 2 (3.92%)
+ C: 2 (3.92%)
+ val: 2 (3.92%)
+ B: 2 (3.92%)
+ a: 2 (3.92%)
+ A: 2 (3.92%)
+ foo: 2 (3.92%)
+ b: 2 (3.92%)
+ intern: 1 (1.96%)
+ Object: 1 (1.96%)
+ Bool: 1 (1.96%)
--- Detection of variance constraints on formal parameter types ---
-- Generic classes --
list:
Average number of class refinments by classes: 0.00
Average number of class refinments by refined classes: na
-Number of properties: 18
- Number of MAttribute: 3 (16.66%)
- Number of MMethod: 15 (83.33%)
+Number of properties: 21
+ Number of MAttribute: 3 (14.28%)
+ Number of MMethod: 18 (85.71%)
-Number of property definitions: 20
-Number of redefined properties: 1 (5.55%)
-Average number of property redefinitions by property: 0.11
+Number of property definitions: 23
+Number of redefined properties: 1 (4.76%)
+Average number of property redefinitions by property: 0.09
Average number of property redefinitions by redefined property: 2.00
--- Explicit vs. Implicit Self ---
-Total number of self: 5
-Total number of implicit self: 4 (80.00%)
+Total number of self: 4
+Total number of implicit self: 4 (100.00%)
--- Construction of tables ---
Number of runtime classes: 6 (excluding interfaces and abstract classes)
Average number of composing class definition by runtime class: 2.00
-Total size of tables (classes and instances): 23 (not including stuff like info for subtyping or call-next-method)
-Average size of table by runtime class: 3.83
-Values never redefined: 17 (73.91%)
+Total size of tables (classes and instances): 31 (not including stuff like info for subtyping or call-next-method)
+Average size of table by runtime class: 5.16
+Values never redefined: 25 (80.64%)
generating package_hierarchy.dot
generating module_hierarchy.dot
--- Metrics of the explitic static types ---
-Total number of explicit static types: 9
+Total number of explicit static types: 8
Statistics of type usage:
population: 4
minimum value: 1
- maximum value: 6
- total value: 9
- average value: 2.25
+ maximum value: 5
+ total value: 8
+ average value: 2.00
distribution:
- <=1: sub-population=3 (75.00%); cumulated value=3 (33.33%)
- <=8: sub-population=1 (25.00%); cumulated value=6 (66.66%)
+ <=1: sub-population=3 (75.00%); cumulated value=3 (37.50%)
+ <=8: sub-population=1 (25.00%); cumulated value=5 (62.50%)
list:
- Int: 6 (66.66%)
- C: 1 (11.11%)
- B: 1 (11.11%)
- A: 1 (11.11%)
+ Int: 5 (62.50%)
+ C: 1 (12.50%)
+ B: 1 (12.50%)
+ A: 1 (12.50%)
# MClasses metrics
std: 0.926
sum: 6
cnbp: number of accessible properties (inherited + local)
- avg: 3.0
- max: C (7)
- min: Object (1)
- std: 2.36
- sum: 24
+ avg: 4.0
+ max: C (9)
+ min: Object (2)
+ std: 2.591
+ sum: 33
cnba: number of accessible attributes (inherited + local)
avg: 0.0
max: C (2)
std: 0.845
sum: 3
cnbi: number of accessible constructors (inherited + local)
- avg: 1.0
- max: B (2)
- min: Object (1)
- std: 0.378
- sum: 8
+ avg: 2.0
+ max: A (3)
+ min: Object (2)
+ std: 0.655
+ sum: 17
cnbm: number of accessible methods (inherited + local)
- avg: 3.0
- max: B (5)
- min: Object (1)
- std: 1.773
- sum: 21
+ avg: 4.0
+ max: C (7)
+ min: Object (2)
+ std: 1.927
+ sum: 30
cnbv: number of accessible virtual types (inherited + local)
avg: 0.0
max: Object (0)
std: 0.0
sum: 0
cnbip: number of introduced properties
- avg: 2.0
- max: C (6)
+ avg: 3.0
+ max: C (7)
min: Bool (0)
std: 2.268
- sum: 18
+ sum: 21
cnbrp: number of redefined properties
avg: 0.0
max: A (1)
std: 0.535
sum: 2
cnbhp: number of inherited properties
- avg: 0.0
- max: Bool (1)
+ avg: 1.0
+ max: Bool (2)
min: Object (0)
- std: 0.926
- sum: 6
+ std: 1.0
+ sum: 12
## global metrics
cnoa: number of ancestor classes
std: 0.926
sum: 6
cnbp: number of accessible properties (inherited + local)
- avg: 3.0
- max: C (7)
- min: Object (1)
- std: 2.36
- sum: 24
+ avg: 4.0
+ max: C (9)
+ min: Object (2)
+ std: 2.591
+ sum: 33
cnba: number of accessible attributes (inherited + local)
avg: 0.0
max: C (2)
std: 0.845
sum: 3
cnbi: number of accessible constructors (inherited + local)
- avg: 1.0
- max: B (2)
- min: Object (1)
- std: 0.378
- sum: 8
+ avg: 2.0
+ max: A (3)
+ min: Object (2)
+ std: 0.655
+ sum: 17
cnbm: number of accessible methods (inherited + local)
- avg: 3.0
- max: B (5)
- min: Object (1)
- std: 1.773
- sum: 21
+ avg: 4.0
+ max: C (7)
+ min: Object (2)
+ std: 1.927
+ sum: 30
cnbv: number of accessible virtual types (inherited + local)
avg: 0.0
max: Object (0)
std: 0.0
sum: 0
cnbip: number of introduced properties
- avg: 2.0
- max: C (6)
+ avg: 3.0
+ max: C (7)
min: Bool (0)
std: 2.268
- sum: 18
+ sum: 21
cnbrp: number of redefined properties
avg: 0.0
max: A (1)
std: 0.535
sum: 2
cnbhp: number of inherited properties
- avg: 0.0
- max: Bool (1)
+ avg: 1.0
+ max: Bool (2)
min: Object (0)
- std: 0.926
- sum: 6
+ std: 1.0
+ sum: 12
# MModules metrics
sum: 0.143
# Mendel metrics
- large mclasses (threshold: 3.915)
+ large mclasses (threshold: 4.915)
+ B: 5
C: 5
- B: 4
- Sys: 4
- budding mclasses (threshold: 5.033)
- blooming mclasses (threshold: 21.874)
- C: 25.0
+ budding mclasses (threshold: 3.231)
+ C: 3.5
+ blooming mclasses (threshold: 15.285)
+ C: 17.5
--- Detection of the usage of covariance static type conformance ---
-- Total --
- Kinds of the subtype -
list:
- primitive type: 6 (100.00%)
- total: 6
+ primitive type: 5 (100.00%)
+ total: 5
- Variance -
list:
- monomorph: 6 (100.00%)
- total: 6
+ monomorph: 5 (100.00%)
+ total: 5
- Classes of the subtype -
list:
- Int: 6 (100.00%)
- total: 6
+ Int: 5 (100.00%)
+ total: 5
-- On covariance only --
- Specific covariance case explanations -
list:
cnbna: number of accessible nullable attributes (inherited + local) -- nothing
sum: 0
--- Sends on Nullable Receiver ---
-Total number of sends: 19
+Total number of sends: 18
Number of sends on a unsafe nullable receiver: 0 (0.00%)
Number of sends on a safe nullable receiver: 0 (0.00%)
Number of buggy sends (cannot determine the type of the receiver): 0 (0.00%)
std: 0.0
sum: 17
mnlm: number of live methods in a mmodule
- avg: 14.0
- max: base_simple3 (14)
- min: base_simple3 (14)
- std: 0.0
- sum: 14
- mnlmd: number of live method definitions in a mmodule
avg: 16.0
max: base_simple3 (16)
min: base_simple3 (16)
std: 0.0
sum: 16
+ mnlmd: number of live method definitions in a mmodule
+ avg: 18.0
+ max: base_simple3 (18)
+ min: base_simple3 (18)
+ std: 0.0
+ sum: 18
mnldd: number of dead method definitions in a mmodule
avg: 0.0
max: base_simple3 (0)
sum: 0
## Callsites
-* 23 live callsites
+* 21 live callsites
MMethodDef locally designated (by number of CallSites)
- population: 14
+ population: 12
minimum value: 1
maximum value: 10
- total value: 23
- average value: 1.64
+ total value: 21
+ average value: 1.75
distribution:
- <=1: sub-population=13 (92.85%); cumulated value=13 (56.52%)
- <=16: sub-population=1 (7.14%); cumulated value=10 (43.47%)
+ <=1: sub-population=11 (91.66%); cumulated value=11 (52.38%)
+ <=16: sub-population=1 (8.33%); cumulated value=10 (47.61%)
list:
- base_simple3$Int$output: 10 (43.47%)
- base_simple3$B$val: 1 (4.34%)
- base_simple3$B$val=: 1 (4.34%)
- base_simple3$Object$init: 1 (4.34%)
- base_simple3$C$val2: 1 (4.34%)
+ base_simple3$Int$output: 10 (47.61%)
+ base_simple3$B$val: 1 (4.76%)
+ base_simple3$C$val2: 1 (4.76%)
+ base_simple3$C$val1: 1 (4.76%)
+ base_simple3$B$run: 1 (4.76%)
...
- base_simple3$A$init: 1 (4.34%)
- base_simple3$Sys$baz: 1 (4.34%)
- base_simple3$Sys$bar: 1 (4.34%)
- base_simple3$Sys$foo: 1 (4.34%)
- base_simple3$C$init: 1 (4.34%)
+ base_simple3$A$defaultinit: 1 (4.76%)
+ base_simple3$Sys$baz: 1 (4.76%)
+ base_simple3$Sys$bar: 1 (4.76%)
+ base_simple3$Sys$foo: 1 (4.76%)
+ base_simple3$C$defaultinit: 1 (4.76%)
MMethodDef possibly invoked at runtime (by number of CallSites)
- population: 14
+ population: 12
minimum value: 1
maximum value: 10
- total value: 23
- average value: 1.64
+ total value: 21
+ average value: 1.75
distribution:
- <=1: sub-population=13 (92.85%); cumulated value=13 (56.52%)
- <=16: sub-population=1 (7.14%); cumulated value=10 (43.47%)
+ <=1: sub-population=11 (91.66%); cumulated value=11 (52.38%)
+ <=16: sub-population=1 (8.33%); cumulated value=10 (47.61%)
list:
- base_simple3$Int$output: 10 (43.47%)
- base_simple3$B$val: 1 (4.34%)
- base_simple3$B$val=: 1 (4.34%)
- base_simple3$Object$init: 1 (4.34%)
- base_simple3$C$val2: 1 (4.34%)
+ base_simple3$Int$output: 10 (47.61%)
+ base_simple3$B$val: 1 (4.76%)
+ base_simple3$C$val2: 1 (4.76%)
+ base_simple3$C$val1: 1 (4.76%)
+ base_simple3$B$run: 1 (4.76%)
...
- base_simple3$A$init: 1 (4.34%)
- base_simple3$Sys$baz: 1 (4.34%)
- base_simple3$Sys$bar: 1 (4.34%)
- base_simple3$Sys$foo: 1 (4.34%)
- base_simple3$C$init: 1 (4.34%)
+ base_simple3$A$defaultinit: 1 (4.76%)
+ base_simple3$Sys$baz: 1 (4.76%)
+ base_simple3$Sys$bar: 1 (4.76%)
+ base_simple3$Sys$foo: 1 (4.76%)
+ base_simple3$C$defaultinit: 1 (4.76%)
class_hierarchy.dot
classdef_hierarchy.dot
inheritance/
-total_strengh has 2 lines
-total_endurance has 2 lines
-total_intelligence has 2 lines
-Large class: 6 attributes and 18 methods (4.673A 6.923M Average)
+Large class: 6 attributes and 18 methods (4.673A 6.858M Average)
--------------------
Full name: test_prog$GameTest Location: test_prog/tests/test_game.nit:25,1--33,3
Feature envy:
--- Code Smells Metrics ---
--------------------
Full name: TestNitsmells$LargeClass Location: TestNitsmells/LargeClass/largeclass.nit:20,1--55,3
-Large class: 18 attributes and 48 methods (17.515A 30.464M Average)
+Large class: 18 attributes and 49 methods (17.515A 24.215M Average)
subgraph clusterbase_prot_sig2 {
label = "base_prot_sig2"
base_prot_sig2C [
- label = "{C|- _vpriA: nullable A\l- _vpriA2: A\l|- priA(a: A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l+ init()\l}"color="#58B26A"
+ label = "{C|- _vpriA: nullable A\l- _vpriA2: A\l|- priA(a: A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l+ init()\l+ defaultinit()\l}"color="#58B26A"
]
base_prot_sig2D [
- label = "{D|- _vpubA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vpriA2: A\l|- pubA(a: A)\l- priA(a: A)\l- vpubA(): nullable A\l- vpubA=(vpubA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpubA2(): A\l- vpubA2=(vpubA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l+ init()\l}"color="#58B26A"
+ label = "{D|- _vpubA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vpriA2: A\l|- pubA(a: A)\l- priA(a: A)\l- vpubA(): nullable A\l- vpubA=(vpubA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpubA2(): A\l- vpubA2=(vpubA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l+ init()\l+ defaultinit()\l}"color="#58B26A"
]
}
}
subgraph clusterbase_prot_sig2 {
label = "base_prot_sig2"
base_prot_sig2C [
- label = "{C||+ init()\l}"color="#58B26A"
+ label = "{C||+ init()\l+ defaultinit()\l}"color="#58B26A"
]
}
}
fontsize = 8
]
Object [
- label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ sys(): Sys\l+ init()\l}"
+ label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ sys(): Sys\l+ init()\l+ defaultinit()\l}"
]
Sys [
- label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l+ exit(exit_value: Int)\l+ is_windows(): Bool\l}"
+ label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l+ exit(exit_value: Int)\l+ is_windows(): Bool\l+ defaultinit()\l}"
]
Object -> Sys [dir=back arrowtail=open style=dashed];
Comparable [
- label = "{interface\nComparable||+ \<(other: OTHER): Bool\l+ \<=(other: OTHER): Bool\l+ \>=(other: OTHER): Bool\l+ \>(other: OTHER): Bool\l+ \<=\>(other: OTHER): Int\l+ is_between(c: OTHER, d: OTHER): Bool\l+ max(other: OTHER): OTHER\l+ min(c: OTHER): OTHER\l}"
+ label = "{interface\nComparable||+ \<(other: OTHER): Bool\l+ \<=(other: OTHER): Bool\l+ \>=(other: OTHER): Bool\l+ \>(other: OTHER): Bool\l+ \<=\>(other: OTHER): Int\l+ is_between(c: OTHER, d: OTHER): Bool\l+ max(other: OTHER): OTHER\l+ min(c: OTHER): OTHER\l+ defaultinit()\l}"
]
Object -> Comparable [dir=back arrowtail=open style=dashed];
Discrete [
- label = "{interface\nDiscrete||+ successor(i: Int): OTHER\l+ predecessor(i: Int): OTHER\l+ distance(d: OTHER): Int\l}"
+ label = "{interface\nDiscrete||+ successor(i: Int): OTHER\l+ predecessor(i: Int): OTHER\l+ distance(d: OTHER): Int\l+ defaultinit()\l}"
]
Comparable -> Discrete [dir=back arrowtail=open style=dashed];
Cloneable [
- label = "{interface\nCloneable||+ clone(): SELF\l}"
+ label = "{interface\nCloneable||+ clone(): SELF\l+ defaultinit()\l}"
]
Object -> Cloneable [dir=back arrowtail=open style=dashed];
Numeric [
- label = "{interface\nNumeric||+ +(i: OTHER): OTHER\l+ -(i: OTHER): OTHER\l+ unary -(): OTHER\l+ *(i: OTHER): OTHER\l+ /(i: OTHER): OTHER\l+ to_i(): Int\l+ to_f(): Float\l+ to_b(): Byte\l+ is_zero(): Bool\l+ zero(): OTHER\l+ value_of(val: Numeric): OTHER\l}"
+ label = "{interface\nNumeric||+ +(i: OTHER): OTHER\l+ -(i: OTHER): OTHER\l+ unary -(): OTHER\l+ *(i: OTHER): OTHER\l+ /(i: OTHER): OTHER\l+ to_i(): Int\l+ to_f(): Float\l+ to_b(): Byte\l+ is_zero(): Bool\l+ zero(): OTHER\l+ value_of(val: Numeric): OTHER\l+ defaultinit()\l}"
]
Comparable -> Numeric [dir=back arrowtail=open style=dashed];
Discrete -> Char [dir=back arrowtail=open style=dashed];
Pointer [
- label = "{Pointer||+ nul(): Pointer\l+ address_is_null(): Bool\l+ free()\l- native_equals(o: Pointer): Bool\l}"
+ label = "{Pointer||+ nul(): Pointer\l+ address_is_null(): Bool\l+ free()\l- native_equals(o: Pointer): Bool\l+ defaultinit()\l}"
]
Object -> Pointer [dir=back arrowtail=open style=dashed];
Task [
- label = "{interface\nTask||+ main()\l}"
+ label = "{interface\nTask||+ main()\l+ defaultinit()\l}"
]
Object -> Task [dir=back arrowtail=open style=dashed];
A [
- label = "{A|- _vpubA: nullable A\l- _vproA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vproA2: A\l- _vpriA2: A\l- _vpriB: nullable B\l- _vpriB2: B\l|+ pubA(a: A)\l# proA(a: A)\l- priA(a: A)\l+ pubA2(): A\l# proA2(): A\l- priA2(): A\l+ vpubA(): nullable A\l+ vpubA=(vpubA: nullable A)\l# vproA(): nullable A\l# vproA=(vproA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l+ vpubA2(): A\l+ vpubA2=(vpubA2: A)\l# vproA2(): A\l# vproA2=(vproA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l- priB(a: B)\l- priB2(): B\l- vpriB(): nullable B\l- vpriB=(vpriB: nullable B)\l- vpriB2(): B\l- vpriB2=(vpriB2: B)\l}"
+ label = "{A|- _vpubA: nullable A\l- _vproA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vproA2: A\l- _vpriA2: A\l- _vpriB: nullable B\l- _vpriB2: B\l|+ pubA(a: A)\l# proA(a: A)\l- priA(a: A)\l+ pubA2(): A\l# proA2(): A\l- priA2(): A\l+ vpubA(): nullable A\l+ vpubA=(vpubA: nullable A)\l# vproA(): nullable A\l# vproA=(vproA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l+ vpubA2(): A\l+ vpubA2=(vpubA2: A)\l# vproA2(): A\l# vproA2=(vproA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l- priB(a: B)\l- priB2(): B\l- vpriB(): nullable B\l- vpriB=(vpriB: nullable B)\l- vpriB2(): B\l- vpriB2=(vpriB2: B)\l+ defaultinit()\l}"
]
Object -> A [dir=back arrowtail=open style=dashed];
B [
- label = "{B|- _vpubA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vpriA2: A\l- _vpubB: nullable B\l- _vpriB: nullable B\l- _vpubB2: B\l- _vpriB2: B\l|- pubA(a: A)\l- priA(a: A)\l- vpubA(): nullable A\l- vpubA=(vpubA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpubA2(): A\l- vpubA2=(vpubA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l- pubB(a: B)\l- priB(a: B)\l- vpubB(): nullable B\l- vpubB=(vpubB: nullable B)\l- vpriB(): nullable B\l- vpriB=(vpriB: nullable B)\l- vpubB2(): B\l- vpubB2=(vpubB2: B)\l- vpriB2(): B\l- vpriB2=(vpriB2: B)\l}"
+ label = "{B|- _vpubA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vpriA2: A\l- _vpubB: nullable B\l- _vpriB: nullable B\l- _vpubB2: B\l- _vpriB2: B\l|- pubA(a: A)\l- priA(a: A)\l- vpubA(): nullable A\l- vpubA=(vpubA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpubA2(): A\l- vpubA2=(vpubA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l- pubB(a: B)\l- priB(a: B)\l- vpubB(): nullable B\l- vpubB=(vpubB: nullable B)\l- vpriB(): nullable B\l- vpriB=(vpriB: nullable B)\l- vpubB2(): B\l- vpubB2=(vpubB2: B)\l- vpriB2(): B\l- vpriB2=(vpriB2: B)\l+ defaultinit()\l}"
]
Object -> B [dir=back arrowtail=open style=dashed];
C [
- label = "{C|- _vpriA: nullable A\l- _vpriA2: A\l|- priA(a: A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l}"
+ label = "{C|- _vpriA: nullable A\l- _vpriA2: A\l|- priA(a: A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l+ defaultinit()\l}"
]
Object -> C [dir=back arrowtail=open style=dashed];
D [
- label = "{D|- _vpubA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vpriA2: A\l|- pubA(a: A)\l- priA(a: A)\l- vpubA(): nullable A\l- vpubA=(vpubA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpubA2(): A\l- vpubA2=(vpubA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l}"
+ label = "{D|- _vpubA: nullable A\l- _vpriA: nullable A\l- _vpubA2: A\l- _vpriA2: A\l|- pubA(a: A)\l- priA(a: A)\l- vpubA(): nullable A\l- vpubA=(vpubA: nullable A)\l- vpriA(): nullable A\l- vpriA=(vpriA: nullable A)\l- vpubA2(): A\l- vpubA2=(vpubA2: A)\l- vpriA2(): A\l- vpriA2=(vpriA2: A)\l+ defaultinit()\l}"
]
Object -> D [dir=back arrowtail=open style=dashed];
fontsize = 8
]
Object [
- label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ sys(): Sys\l+ init()\l}"
+ label = "{interface\nObject||+ object_id(): Int\l+ is_same_type(other: Object): Bool\l+ is_same_instance(other: nullable Object): Bool\l+ ==(other: nullable Object): Bool\l+ !=(other: nullable Object): Bool\l+ output()\l+ output_class_name()\l+ hash(): Int\l+ sys(): Sys\l+ init()\l+ defaultinit()\l}"
]
Sys [
- label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l+ exit(exit_value: Int)\l+ is_windows(): Bool\l}"
+ label = "{Sys||+ main()\l+ run()\l+ errno(): Int\l+ exit(exit_value: Int)\l+ is_windows(): Bool\l+ defaultinit()\l}"
]
Object -> Sys [dir=back arrowtail=open style=dashed];
Comparable [
- label = "{interface\nComparable||+ \<(other: OTHER): Bool\l+ \<=(other: OTHER): Bool\l+ \>=(other: OTHER): Bool\l+ \>(other: OTHER): Bool\l+ \<=\>(other: OTHER): Int\l+ is_between(c: OTHER, d: OTHER): Bool\l+ max(other: OTHER): OTHER\l+ min(c: OTHER): OTHER\l}"
+ label = "{interface\nComparable||+ \<(other: OTHER): Bool\l+ \<=(other: OTHER): Bool\l+ \>=(other: OTHER): Bool\l+ \>(other: OTHER): Bool\l+ \<=\>(other: OTHER): Int\l+ is_between(c: OTHER, d: OTHER): Bool\l+ max(other: OTHER): OTHER\l+ min(c: OTHER): OTHER\l+ defaultinit()\l}"
]
Object -> Comparable [dir=back arrowtail=open style=dashed];
Discrete [
- label = "{interface\nDiscrete||+ successor(i: Int): OTHER\l+ predecessor(i: Int): OTHER\l+ distance(d: OTHER): Int\l}"
+ label = "{interface\nDiscrete||+ successor(i: Int): OTHER\l+ predecessor(i: Int): OTHER\l+ distance(d: OTHER): Int\l+ defaultinit()\l}"
]
Comparable -> Discrete [dir=back arrowtail=open style=dashed];
Cloneable [
- label = "{interface\nCloneable||+ clone(): SELF\l}"
+ label = "{interface\nCloneable||+ clone(): SELF\l+ defaultinit()\l}"
]
Object -> Cloneable [dir=back arrowtail=open style=dashed];
Numeric [
- label = "{interface\nNumeric||+ +(i: OTHER): OTHER\l+ -(i: OTHER): OTHER\l+ unary -(): OTHER\l+ *(i: OTHER): OTHER\l+ /(i: OTHER): OTHER\l+ to_i(): Int\l+ to_f(): Float\l+ to_b(): Byte\l+ is_zero(): Bool\l+ zero(): OTHER\l+ value_of(val: Numeric): OTHER\l}"
+ label = "{interface\nNumeric||+ +(i: OTHER): OTHER\l+ -(i: OTHER): OTHER\l+ unary -(): OTHER\l+ *(i: OTHER): OTHER\l+ /(i: OTHER): OTHER\l+ to_i(): Int\l+ to_f(): Float\l+ to_b(): Byte\l+ is_zero(): Bool\l+ zero(): OTHER\l+ value_of(val: Numeric): OTHER\l+ defaultinit()\l}"
]
Comparable -> Numeric [dir=back arrowtail=open style=dashed];
Discrete -> Char [dir=back arrowtail=open style=dashed];
Pointer [
- label = "{Pointer||+ nul(): Pointer\l+ address_is_null(): Bool\l+ free()\l}"
+ label = "{Pointer||+ nul(): Pointer\l+ address_is_null(): Bool\l+ free()\l+ defaultinit()\l}"
]
Object -> Pointer [dir=back arrowtail=open style=dashed];
Task [
- label = "{interface\nTask||+ main()\l}"
+ label = "{interface\nTask||+ main()\l+ defaultinit()\l}"
]
Object -> Task [dir=back arrowtail=open style=dashed];
A [
- label = "{A||+ pubA(a: A)\l# proA(a: A)\l+ pubA2(): A\l# proA2(): A\l+ vpubA(): nullable A\l+ vpubA=(vpubA: nullable A)\l# vproA(): nullable A\l# vproA=(vproA: nullable A)\l+ vpubA2(): A\l+ vpubA2=(vpubA2: A)\l# vproA2(): A\l# vproA2=(vproA2: A)\l}"
+ label = "{A||+ pubA(a: A)\l# proA(a: A)\l+ pubA2(): A\l# proA2(): A\l+ vpubA(): nullable A\l+ vpubA=(vpubA: nullable A)\l# vproA(): nullable A\l# vproA=(vproA: nullable A)\l+ vpubA2(): A\l+ vpubA2=(vpubA2: A)\l# vproA2(): A\l# vproA2=(vproA2: A)\l+ defaultinit()\l}"
]
Object -> A [dir=back arrowtail=open style=dashed];
C [
- label = "{C||}"
+ label = "{C||+ defaultinit()\l}"
]
Object -> C [dir=back arrowtail=open style=dashed];
+ base_simple3::Sys::foo
fun foo
- base_simple3.nit:49,1--19
+ base_simple3.nit:45,1--19
+ base_simple3$B
class B
- base_simple3.nit:34,1--42,3
+ base_simple3.nit:34,1--38,3
+ base_simple3$Bool
enum Bool
+ base_simple3$C
class C
- base_simple3.nit:44,1--47,3
+ base_simple3.nit:40,1--43,3
+ base_simple3$Int
enum Int
+ base_simple3$Sys
class Sys
- base_simple3.nit:49,1--19
+ base_simple3.nit:45,1--19
-syntax_callref.nit:40,5--8: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:41,5--12: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:42,5--16: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:43,6--13: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:44,5--18: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:48,5--10: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:49,5--14: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:50,5--18: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:51,6--15: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:52,5--20: Error: NOT YET IMPLEMENTED callref expressions.
-syntax_callref.nit:54,5--11: Error: NOT YET IMPLEMENTED callref expressions.
+foo<Sys>
+foo<Sys>
+baz<Sys>
+foo<Sys>
+baz<FunRef0>
+foo<Sys>
+baz<Sys>
+foo<Y>
+foo<Y>
+baz<Y>
+foo<Y>
+baz<FunRef0>
+foo<Y>
+baz<Y>
-alt/syntax_callref_alt1.nit:47,5--6: Error: `y` is a variable, not a method.
+alt/syntax_callref_alt1.nit:55,5--6: Error: `y` is a variable, not a method.
--- /dev/null
+in A::fun1
+in B::fun1
+100
+in B::fun1
+in B::fun1
+in B::fun1
+110
+3
+5
+x is null
+x is null
+x is test
+x is 100
+x is 100
<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</h1>
<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
-<h1 id="base_simple3___base_simple3__B___init">base_simple3$B$init</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
-</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L39"> <span class="nc_k popupable" title="B" data-title="<a href="#base_simple3___base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
-</span><span class="line" id="L40"> <span class="nc_k">end</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__B___Object__init">base_simple3$B$Object::init</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__B___run">base_simple3$B$run</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L37"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__C____val1">base_simple3$C$_val1</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L41"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__C___val1">base_simple3$C$val1</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L41"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__C___val1_61d">base_simple3$C$val1=</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L41"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__C____val2">base_simple3$C$_val2</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L42"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__C___val2">base_simple3$C$val2</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L42"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__C___val2_61d">base_simple3$C$val2=</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L42"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L45"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L46"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L47"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span></span></span></span></code></pre>
<h1 id="base_simple3___base_simple3__Sys___main">base_simple3$Sys$main</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
-</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$init" data-title="<a href="#base_simple3___base_simple3__A___Object__init">call base_simple3$A$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___Object__init">base_simple3$A$init</a><span></span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3___base_simple3__A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
-</span><span class="line" id="L59"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$init" data-title="<a href="#base_simple3___base_simple3__B___init">call base_simple3$B$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___init">base_simple3$B$init</a><span>(v: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3___base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$init" data-title="<a href="#base_simple3___base_simple3__C___Object__init">call base_simple3$C$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___Object__init">base_simple3$C$init</a><span>(val1: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3___base_simple3__C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L66"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
-<h2>AST node: AModule at base_simple3.nit:17,1--66,13</h2>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L49"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L50"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L51"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L52"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L53">
+</span><span class="line" id="L54"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$defaultinit" data-title="<a href="#base_simple3___base_simple3__A___defaultinit">call base_simple3$A$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___defaultinit">base_simple3$A$defaultinit</a><span></span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3___base_simple3__A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L55"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L56">
+</span><span class="line" id="L57"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$defaultinit" data-title="<a href="#base_simple3___base_simple3__B___defaultinit">call base_simple3$B$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___defaultinit">base_simple3$B$defaultinit</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3___base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L58"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L59">
+</span><span class="line" id="L60"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$defaultinit" data-title="<a href="#base_simple3___base_simple3__C___defaultinit">call base_simple3$C$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___defaultinit">base_simple3$C$defaultinit</a><span>(val1: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3___base_simple3__C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L61"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<h2>AST node: AModule at base_simple3.nit:17,1--62,13</h2>
<pre><code><span class="nitcode"><span class="line" id="L17"><span class="nc_k">import</span> <span class="nc_k">end</span>
</span><span class="line" id="L18">
</span><span class="nc_cdef foldable" id="base_simple3$Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_t nc_def popupable" title="class Object" data-title="<a href="#base_simple3___base_simple3__Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Bool">base_simple3$Bool</a></li><li><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></li><li><a href="#base_simple3___base_simple3__A">base_simple3$A</a></li><li><a href="#base_simple3___base_simple3__B">base_simple3$B</a></li><li><a href="#base_simple3___base_simple3__C">base_simple3$C</a></li><li><a href="#base_simple3___base_simple3__Sys">base_simple3$Sys</a></li></ul></div></div>" data-toggle="popover">Object</span>
</span></span><span class="line" id="L33">
</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class B" data-title="<a href="#base_simple3___base_simple3__B">class B</a>" data-content="<div><b>class</b> <span>B</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">B</span>
</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
-</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L39"> <span class="nc_k popupable" title="B" data-title="<a href="#base_simple3___base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
-</span><span class="line" id="L40"> <span class="nc_k">end</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="line" id="L42"><span class="nc_k">end</span>
-</span></span><span class="line" id="L43">
-</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3___base_simple3__C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
-</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
-</span></span><span class="line" id="L47"><span class="nc_k">end</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L37"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="line" id="L38"><span class="nc_k">end</span>
+</span></span><span class="line" id="L39">
+</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L40"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3___base_simple3__C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
+</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L41"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L42"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
+</span></span><span class="line" id="L43"><span class="nc_k">end</span>
+</span></span><span class="line" id="L44">
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L45"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L46"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L47"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
</span></span><span class="line" id="L48">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
-</span></span><span class="line" id="L52">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
-</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$init" data-title="<a href="#base_simple3___base_simple3__A___Object__init">call base_simple3$A$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___Object__init">base_simple3$A$init</a><span></span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3___base_simple3__A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
-</span><span class="line" id="L59"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$init" data-title="<a href="#base_simple3___base_simple3__B___init">call base_simple3$B$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___init">base_simple3$B$init</a><span>(v: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3___base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
-</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$init" data-title="<a href="#base_simple3___base_simple3__C___Object__init">call base_simple3$C$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___Object__init">base_simple3$C$init</a><span>(val1: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3___base_simple3__C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
-</span><span class="line" id="L66"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L49"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L50"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L51"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L52"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L53">
+</span><span class="line" id="L54"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$defaultinit" data-title="<a href="#base_simple3___base_simple3__A___defaultinit">call base_simple3$A$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___defaultinit">base_simple3$A$defaultinit</a><span></span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3___base_simple3__A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L55"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L56">
+</span><span class="line" id="L57"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$defaultinit" data-title="<a href="#base_simple3___base_simple3__B___defaultinit">call base_simple3$B$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___defaultinit">base_simple3$B$defaultinit</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3___base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L58"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
+</span><span class="line" id="L59">
+</span><span class="line" id="L60"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$defaultinit" data-title="<a href="#base_simple3___base_simple3__C___defaultinit">call base_simple3$C$defaultinit</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___defaultinit">base_simple3$C$defaultinit</a><span>(val1: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3___base_simple3__C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L61"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
<h2>AST node: ANoImport at base_simple3.nit:17,1--10</h2>
<pre><code><span class="nitcode"><span class="line" id="L17"><span class="nc_k">import</span> <span class="nc_k">end</span></span></span></code></pre>
<h2>AST node: APublicVisibility at base_simple3.nit:17,1</h2>
<pre><code><span class="nitcode"><span class="line" id="L26"> <span class="nc_k">is</span></span></span></code></pre>
<h2>AST node: AAnnotation at base_simple3.nit:26,16--21</h2>
<pre><code><span class="nitcode"><span class="line" id="L26"> <span class="nc_i">intern</span></span></span></code></pre>
-<h2>AST node: AIdAtid at bas***TRUNCATED***
+<h2>AST node: AIdAtid at base_simple3.nit:26,16--21</h2>
+<pre><code><span class="nitcode"><span class="line" id="L26"> <span class="nc_i">intern</span></span></span></code></pre>
+<h2>AST node: AConcreteClasskind at base_simple3.nit:29,1--5</h2>
+<pre><code><span class="nitcode"><span class="line" id="L29"><span class="nc_k">class</span></span></span></code></pre>
+<h2>AST node: TKwclass at base_simple3.nit:29,1--5</h2>
+<pre><code><span class="nitcode"><span class="line" id="L29"><span class="nc_k">class</span></span></span></code></pre>
+<h2>AST node: TKwinit at base_simple3.nit:30,2--5</h2>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span></span></span></span></code></pre>
+<h2>AST node: TKwdo at base_simple3.nit:30,7--8</h2>
+<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_k">do</span></span></span></code></pre>
+<h2>AST node: ACallExpr at base_simple3.nit:30,10--17</h2>
+<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">5</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></code></pre>
+<h2>AST node: AIntegerExpr at base_simple3.nit:30,10</h2>
+<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">5</span></span></span></code></pre>
+<h2>AST node: TInteger at base_simple3.nit:30,10</h2>
+<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">5</span></span></span></code></pre>
+<h2>AST node: AQid at base_simple3.nit:30,12--17</h2>
+<pre><code><span class="nitcode"><span class="line" id="L30"><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></code></pre>
+<h2>AST node: AListExprs at base_simple3.nit:30,17</h2>
+<pre><code><span class="nitcode"></span></code></pre>
+<h2>AST node: AAttrPropdef at base_simple3.nit:35,2--13</h2>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<h2>AST node: TKwvar at base_simple3.nit:35,2--4</h2>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span></span></span></span></code></pre>
+<h2>AST node: AType at base_simple3.nit:35,11--13</h2>
+<pre><code><span class="nitcode"><span class="line" id="L35"> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></code></pre>
+<h2>AST node: AImplicitSelfExpr at base_simple3.nit:37,13</h2>
+<pre><code><span class="nitcode"></span></code></pre>
+<h2>AST node: TAssign at base_simple3.nit:42,16</h2>
+<pre><code><span class="nitcode"><span class="line" id="L42"> <span>=</span></span></span></code></pre>
+<h2>AST node: ATopClassdef at base_simple3.nit:45,1--19</h2>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L45"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3___base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___ou***TRUNCATED***
# test_prog::Dwar
* 1: Dwarf (test_prog::Dwarf)
+ * 2: defaultinit (test_prog::Dwarf::defaultinit)
All entities, including fictive ones:
list:
- MMethodDef: 17 (30.35%)
- MMethod: 15 (26.78%)
- MClassDef: 7 (12.50%)
- MClass: 7 (12.50%)
- MAttributeDef: 3 (5.35%)
- MAttribute: 3 (5.35%)
- Model: 1 (1.78%)
- MGroup: 1 (1.78%)
- MPackage: 1 (1.78%)
- MModule: 1 (1.78%)
+ MMethodDef: 20 (32.25%)
+ MMethod: 18 (29.03%)
+ MClassDef: 7 (11.29%)
+ MClass: 7 (11.29%)
+ MAttributeDef: 3 (4.83%)
+ MAttribute: 3 (4.83%)
+ Model: 1 (1.61%)
+ MGroup: 1 (1.61%)
+ MPackage: 1 (1.61%)
+ MModule: 1 (1.61%)
All entities:
list:
- MMethodDef: 17 (30.35%)
- MMethod: 15 (26.78%)
+ MMethodDef: 20 (32.25%)
+ MMethod: 18 (29.03%)
+ MClassDef: 7 (11.29%)
+ MClass: 7 (11.29%)
+ MAttributeDef: 3 (4.83%)
+ MAttribute: 3 (4.83%)
+ Model: 1 (1.61%)
+ MGroup: 1 (1.61%)
+ MPackage: 1 (1.61%)
+ MModule: 1 (1.61%)
+
+All non-private entities:
+ list:
+ MMethodDef: 20 (35.71%)
+ MMethod: 18 (32.14%)
MClassDef: 7 (12.50%)
MClass: 7 (12.50%)
- MAttributeDef: 3 (5.35%)
- MAttribute: 3 (5.35%)
- Model: 1 (1.78%)
+ MModule: 1 (1.78%)
MGroup: 1 (1.78%)
MPackage: 1 (1.78%)
- MModule: 1 (1.78%)
+ Model: 1 (1.78%)
-All non-private entities:
+All documented non-private entities:
+ list:
+
+All public entities:
list:
MMethodDef: 17 (34.00%)
MMethod: 15 (30.00%)
MPackage: 1 (2.00%)
Model: 1 (2.00%)
-All documented non-private entities:
- list:
-
-All public entities:
- list:
- MMethodDef: 14 (31.81%)
- MMethod: 12 (27.27%)
- MClassDef: 7 (15.90%)
- MClass: 7 (15.90%)
- MModule: 1 (2.27%)
- MGroup: 1 (2.27%)
- MPackage: 1 (2.27%)
- Model: 1 (2.27%)
-
All documented public entities:
list:
# Classes of entities
population: 9
minimum value: 1
- maximum value: 17
- total value: 55
- average value: 6.11
+ maximum value: 20
+ total value: 61
+ average value: 6.77
distribution:
- <=1: sub-population=3 (33.33%); cumulated value=3 (5.45%)
- <=4: sub-population=2 (22.22%); cumulated value=6 (10.90%)
- <=8: sub-population=2 (22.22%); cumulated value=14 (25.45%)
- <=16: sub-population=1 (11.11%); cumulated value=15 (27.27%)
- <=32: sub-population=1 (11.11%); cumulated value=17 (30.90%)
+ <=1: sub-population=3 (33.33%); cumulated value=3 (4.91%)
+ <=4: sub-population=2 (22.22%); cumulated value=6 (9.83%)
+ <=8: sub-population=2 (22.22%); cumulated value=14 (22.95%)
+ <=32: sub-population=2 (22.22%); cumulated value=38 (62.29%)
list:
- MMethodDef: 17 (30.90%)
- MMethod: 15 (27.27%)
- MClassDef: 7 (12.72%)
- MClass: 7 (12.72%)
- MAttributeDef: 3 (5.45%)
- MAttribute: 3 (5.45%)
- MPackage: 1 (1.81%)
- MGroup: 1 (1.81%)
- MModule: 1 (1.81%)
+ MMethodDef: 20 (32.78%)
+ MMethod: 18 (29.50%)
+ MClassDef: 7 (11.47%)
+ MClass: 7 (11.47%)
+ MAttributeDef: 3 (4.91%)
+ MAttribute: 3 (4.91%)
+ MPackage: 1 (1.63%)
+ MGroup: 1 (1.63%)
+ MModule: 1 (1.63%)
# Name length of entities
- population: 55
+ population: 61
minimum value: 12
maximum value: 36
- total value: 1124
- average value: 20.43
+ total value: 1310
+ average value: 21.47
distribution:
- <=12: sub-population=1 (1.81%); cumulated value=12 (1.06%)
- <=24: sub-population=46 (83.63%); cumulated value=874 (77.75%)
- <=48: sub-population=8 (14.54%); cumulated value=238 (21.17%)
+ <=12: sub-population=1 (1.63%); cumulated value=12 (0.91%)
+ <=24: sub-population=44 (72.13%); cumulated value=834 (63.66%)
+ <=48: sub-population=16 (26.22%); cumulated value=464 (35.41%)
list:
- base_simple3::base_simple3::C::_val2: 36 (3.20%)
- base_simple3::base_simple3::C::_val1: 36 (3.20%)
- base_simple3::base_simple3::B::_val: 35 (3.11%)
- base_simple3$A$Object::init: 27 (2.40%)
- base_simple3$C$Object::init: 27 (2.40%)
- base_simple3::base_simple3: 26 (2.31%)
- base_simple3::Object::init: 26 (2.31%)
- base_simple3::Int::output: 25 (2.22%)
- base_simple3$Object$init: 24 (2.13%)
- base_simple3::Sys::main: 23 (2.04%)
+ base_simple3::base_simple3::C::_val1: 36 (2.74%)
+ base_simple3::base_simple3::C::_val2: 36 (2.74%)
+ base_simple3::base_simple3::B::_val: 35 (2.67%)
+ base_simple3::Object::defaultinit: 33 (2.51%)
+ base_simple3$Object$defaultinit: 31 (2.36%)
+ base_simple3::A::defaultinit: 28 (2.13%)
+ base_simple3::C::defaultinit: 28 (2.13%)
+ base_simple3::B::defaultinit: 28 (2.13%)
+ base_simple3$B$Object::init: 27 (2.06%)
+ base_simple3$A$Object::init: 27 (2.06%)
...
- base_simple3$Sys: 16 (1.42%)
- base_simple3$Int: 16 (1.42%)
- base_simple3::A: 15 (1.33%)
- base_simple3::B: 15 (1.33%)
- base_simple3::C: 15 (1.33%)
- base_simple3$B: 14 (1.24%)
- base_simple3$C: 14 (1.24%)
- base_simple3$A: 14 (1.24%)
- base_simple3>: 13 (1.15%)
- base_simple3: 12 (1.06%)
+ base_simple3$Int: 16 (1.22%)
+ base_simple3$Sys: 16 (1.22%)
+ base_simple3::A: 15 (1.14%)
+ base_simple3::B: 15 (1.14%)
+ base_simple3::C: 15 (1.14%)
+ base_simple3$A: 14 (1.06%)
+ base_simple3$B: 14 (1.06%)
+ base_simple3$C: 14 (1.06%)
+ base_simple3>: 13 (0.99%)
+ base_simple3: 12 (0.91%)
# All entities
base_simple3 MPackage base_simple3.nit
base_simple3> MGroup base_simple3.nit
-base_simple3::base_simple3 MModule base_simple3.nit:17,1--66,13
+base_simple3::base_simple3 MModule base_simple3.nit:17,1--62,13
base_simple3::Object MClass base_simple3.nit:19,1--20,3
base_simple3$Object MClassDef base_simple3.nit:19,1--20,3
base_simple3::Object::init MMethod base_simple3.nit:19,1--20,3
base_simple3$Object$init MMethodDef base_simple3.nit:19,1--20,3
+base_simple3::Object::defaultinit MMethod base_simple3.nit:19,1--20,3
+base_simple3$Object$defaultinit MMethodDef base_simple3.nit:19,1--20,3
base_simple3::Bool MClass base_simple3.nit:22,1--23,3
base_simple3$Bool MClassDef base_simple3.nit:22,1--23,3
base_simple3::Int MClass base_simple3.nit:25,1--27,3
base_simple3$A$Object::init MMethodDef base_simple3.nit:30,2--17
base_simple3::A::run MMethod base_simple3.nit:31,2--20
base_simple3$A$run MMethodDef base_simple3.nit:31,2--20
-base_simple3::B MClass base_simple3.nit:34,1--42,3
-base_simple3$B MClassDef base_simple3.nit:34,1--42,3
+base_simple3::A::defaultinit MMethod base_simple3.nit:29,1--32,3
+base_simple3$A$defaultinit MMethodDef base_simple3.nit:29,1--32,3
+base_simple3::B MClass base_simple3.nit:34,1--38,3
+base_simple3$B MClassDef base_simple3.nit:34,1--38,3
base_simple3::base_simple3::B::_val MAttribute base_simple3.nit:35,2--13
base_simple3$B$_val MAttributeDef base_simple3.nit:35,2--13
base_simple3::B::val MMethod base_simple3.nit:35,2--13
base_simple3$B$val MMethodDef base_simple3.nit:35,2--13
base_simple3::B::val= MMethod base_simple3.nit:35,2--13
base_simple3$B$val= MMethodDef base_simple3.nit:35,2--13
-base_simple3::B::init MMethod base_simple3.nit:36,2--40,4
-base_simple3$B$init MMethodDef base_simple3.nit:36,2--40,4
-base_simple3::B::run MMethod base_simple3.nit:41,2--22
-base_simple3$B$run MMethodDef base_simple3.nit:41,2--22
-base_simple3::C MClass base_simple3.nit:44,1--47,3
-base_simple3$C MClassDef base_simple3.nit:44,1--47,3
-base_simple3::base_simple3::C::_val1 MAttribute base_simple3.nit:45,2--14
-base_simple3$C$_val1 MAttributeDef base_simple3.nit:45,2--14
-base_simple3::C::val1 MMethod base_simple3.nit:45,2--14
-base_simple3$C$val1 MMethodDef base_simple3.nit:45,2--14
-base_simple3::C::val1= MMethod base_simple3.nit:45,2--14
-base_simple3$C$val1= MMethodDef base_simple3.nit:45,2--14
-base_simple3::base_simple3::C::_val2 MAttribute base_simple3.nit:46,2--19
-base_simple3$C$_val2 MAttributeDef base_simple3.nit:46,2--19
-base_simple3::C::val2 MMethod base_simple3.nit:46,2--19
-base_simple3$C$val2 MMethodDef base_simple3.nit:46,2--19
-base_simple3::C::val2= MMethod base_simple3.nit:46,2--19
-base_simple3$C$val2= MMethodDef base_simple3.nit:46,2--19
-base_simple3$C$Object::init MMethodDef base_simple3.nit:44,1--47,3
-base_simple3::Sys MClass base_simple3.nit:49,1--19
-base_simple3$Sys MClassDef base_simple3.nit:49,1--19
-base_simple3::Sys::foo MMethod base_simple3.nit:49,1--19
-base_simple3$Sys$foo MMethodDef base_simple3.nit:49,1--19
-base_simple3::Sys::bar MMethod base_simple3.nit:50,1--27
-base_simple3$Sys$bar MMethodDef base_simple3.nit:50,1--27
-base_simple3::Sys::baz MMethod base_simple3.nit:51,1--24
-base_simple3$Sys$baz MMethodDef base_simple3.nit:51,1--24
-base_simple3::Sys::main MMethod base_simple3.nit:53,1--66,13
-base_simple3$Sys$main MMethodDef base_simple3.nit:53,1--66,13
+base_simple3$B$Object::init MMethodDef base_simple3.nit:36,2--17
+base_simple3::B::run MMethod base_simple3.nit:37,2--22
+base_simple3$B$run MMethodDef base_simple3.nit:37,2--22
+base_simple3::B::defaultinit MMethod base_simple3.nit:34,1--38,3
+base_simple3$B$defaultinit MMethodDef base_simple3.nit:34,1--38,3
+base_simple3::C MClass base_simple3.nit:40,1--43,3
+base_simple3$C MClassDef base_simple3.nit:40,1--43,3
+base_simple3::base_simple3::C::_val1 MAttribute base_simple3.nit:41,2--14
+base_simple3$C$_val1 MAttributeDef base_simple3.nit:41,2--14
+base_simple3::C::val1 MMethod base_simple3.nit:41,2--14
+base_simple3$C$val1 MMethodDef base_simple3.nit:41,2--14
+base_simple3::C::val1= MMethod base_simple3.nit:41,2--14
+base_simple3$C$val1= MMethodDef base_simple3.nit:41,2--14
+base_simple3::base_simple3::C::_val2 MAttribute base_simple3.nit:42,2--19
+base_simple3$C$_val2 MAttributeDef base_simple3.nit:42,2--19
+base_simple3::C::val2 MMethod base_simple3.nit:42,2--19
+base_simple3$C$val2 MMethodDef base_simple3.nit:42,2--19
+base_simple3::C::val2= MMethod base_simple3.nit:42,2--19
+base_simple3$C$val2= MMethodDef base_simple3.nit:42,2--19
+base_simple3::C::defaultinit MMethod base_simple3.nit:40,1--43,3
+base_simple3$C$defaultinit MMethodDef base_simple3.nit:40,1--43,3
+base_simple3::Sys MClass base_simple3.nit:45,1--19
+base_simple3$Sys MClassDef base_simple3.nit:45,1--19
+base_simple3::Sys::foo MMethod base_simple3.nit:45,1--19
+base_simple3$Sys$foo MMethodDef base_simple3.nit:45,1--19
+base_simple3::Sys::bar MMethod base_simple3.nit:46,1--27
+base_simple3$Sys$bar MMethodDef base_simple3.nit:46,1--27
+base_simple3::Sys::baz MMethod base_simple3.nit:47,1--24
+base_simple3$Sys$baz MMethodDef base_simple3.nit:47,1--24
+base_simple3::Sys::main MMethod base_simple3.nit:49,1--62,13
+base_simple3$Sys$main MMethodDef base_simple3.nit:49,1--62,13
All entities, including fictive ones:
list:
- MMethodDef: 49 (49.49%)
- MClassDef: 21 (21.21%)
- MClass: 10 (10.10%)
- MMethod: 9 (9.09%)
- MModule: 5 (5.05%)
- MGroup: 2 (2.02%)
- MPackage: 2 (2.02%)
- Model: 1 (1.01%)
+ MMethodDef: 59 (49.57%)
+ MClassDef: 21 (17.64%)
+ MMethod: 19 (15.96%)
+ MClass: 10 (8.40%)
+ MModule: 5 (4.20%)
+ MGroup: 2 (1.68%)
+ MPackage: 2 (1.68%)
+ Model: 1 (0.84%)
All entities:
list:
- MMethodDef: 49 (49.49%)
- MClassDef: 21 (21.21%)
- MClass: 10 (10.10%)
- MMethod: 9 (9.09%)
- MModule: 5 (5.05%)
- MGroup: 2 (2.02%)
- MPackage: 2 (2.02%)
- Model: 1 (1.01%)
+ MMethodDef: 59 (49.57%)
+ MClassDef: 21 (17.64%)
+ MMethod: 19 (15.96%)
+ MClass: 10 (8.40%)
+ MModule: 5 (4.20%)
+ MGroup: 2 (1.68%)
+ MPackage: 2 (1.68%)
+ Model: 1 (0.84%)
All non-private entities:
list:
- MMethodDef: 14 (30.43%)
- MClassDef: 11 (23.91%)
- MMethod: 6 (13.04%)
- MClass: 5 (10.86%)
- MModule: 5 (10.86%)
- MGroup: 2 (4.34%)
- MPackage: 2 (4.34%)
- Model: 1 (2.17%)
+ MMethodDef: 19 (33.92%)
+ MMethod: 11 (19.64%)
+ MClassDef: 11 (19.64%)
+ MClass: 5 (8.92%)
+ MModule: 5 (8.92%)
+ MGroup: 2 (3.57%)
+ MPackage: 2 (3.57%)
+ Model: 1 (1.78%)
All documented non-private entities:
list:
All public entities:
list:
- MMethodDef: 14 (30.43%)
- MClassDef: 11 (23.91%)
- MMethod: 6 (13.04%)
- MClass: 5 (10.86%)
- MModule: 5 (10.86%)
- MGroup: 2 (4.34%)
- MPackage: 2 (4.34%)
- Model: 1 (2.17%)
+ MMethodDef: 19 (33.92%)
+ MMethod: 11 (19.64%)
+ MClassDef: 11 (19.64%)
+ MClass: 5 (8.92%)
+ MModule: 5 (8.92%)
+ MGroup: 2 (3.57%)
+ MPackage: 2 (3.57%)
+ Model: 1 (1.78%)
All documented public entities:
list:
# Classes of entities
population: 7
minimum value: 2
- maximum value: 49
- total value: 98
- average value: 14.00
+ maximum value: 59
+ total value: 118
+ average value: 16.85
distribution:
- <=2: sub-population=2 (28.57%); cumulated value=4 (4.08%)
- <=8: sub-population=1 (14.28%); cumulated value=5 (5.10%)
- <=16: sub-population=2 (28.57%); cumulated value=19 (19.38%)
- <=32: sub-population=1 (14.28%); cumulated value=21 (21.42%)
- <=64: sub-population=1 (14.28%); cumulated value=49 (50.00%)
+ <=2: sub-population=2 (28.57%); cumulated value=4 (3.38%)
+ <=8: sub-population=1 (14.28%); cumulated value=5 (4.23%)
+ <=16: sub-population=1 (14.28%); cumulated value=10 (8.47%)
+ <=32: sub-population=2 (28.57%); cumulated value=40 (33.89%)
+ <=64: sub-population=1 (14.28%); cumulated value=59 (50.00%)
list:
- MMethodDef: 49 (50.00%)
- MClassDef: 21 (21.42%)
- MClass: 10 (10.20%)
- MMethod: 9 (9.18%)
- MModule: 5 (5.10%)
- MGroup: 2 (2.04%)
- MPackage: 2 (2.04%)
+ MMethodDef: 59 (50.00%)
+ MClassDef: 21 (17.79%)
+ MMethod: 19 (16.10%)
+ MClass: 10 (8.47%)
+ MModule: 5 (4.23%)
+ MGroup: 2 (1.69%)
+ MPackage: 2 (1.69%)
# Name length of entities
- population: 98
+ population: 118
minimum value: 5
maximum value: 44
- total value: 1762
- average value: 17.97
+ total value: 2229
+ average value: 18.88
distribution:
- <=5: sub-population=1 (1.02%); cumulated value=5 (0.28%)
- <=10: sub-population=17 (17.34%); cumulated value=141 (8.00%)
- <=20: sub-population=48 (48.97%); cumulated value=706 (40.06%)
- <=40: sub-population=30 (30.61%); cumulated value=822 (46.65%)
- <=80: sub-population=2 (2.04%); cumulated value=88 (4.99%)
+ <=5: sub-population=1 (0.84%); cumulated value=5 (0.22%)
+ <=10: sub-population=17 (14.40%); cumulated value=141 (6.32%)
+ <=20: sub-population=51 (43.22%); cumulated value=765 (34.32%)
+ <=40: sub-population=47 (39.83%); cumulated value=1230 (55.18%)
+ <=80: sub-population=2 (1.69%); cumulated value=88 (3.94%)
list:
- names1::names1$names::n0::P0$names::n0::P::p: 44 (2.49%)
- names1::names1$names::n0::P0$names::n0::A::z: 44 (2.49%)
- names1::names1$names::A0$names::n0::A::z: 40 (2.27%)
- names1::names1$names::A0$names::n0::P::p: 40 (2.27%)
- names1::names1$names::n0::P0$names::A::a: 40 (2.27%)
- names1::names1$names::A0$names::A::a: 36 (2.04%)
- names1::names1$P1$names::n0::P::p: 33 (1.87%)
- names1::names1$P1$names::n0::A::z: 33 (1.87%)
- names::n1$::n0::P0$::n0::A::z: 29 (1.64%)
- names1::names1$P1$names::A::a: 29 (1.64%)
+ names1::names1$names::n0::P0$names::n0::P::p: 44 (1.97%)
+ names1::names1$names::n0::P0$names::n0::A::z: 44 (1.97%)
+ names1::names1$names::A0$names::n0::A::z: 40 (1.79%)
+ names1::names1$names::A0$names::n0::P::p: 40 (1.79%)
+ names1::names1$names::n0::P0$names::A::a: 40 (1.79%)
+ names::P::defaultinit!CONFLICT!MMethod: 38 (1.70%)
+ names1::names1$names::A0$names::A::a: 36 (1.61%)
+ names1::names1$P1$names::n0::P::p: 33 (1.48%)
+ names1::names1$P1$names::n0::A::z: 33 (1.48%)
+ names1::names1$P1$names::A::a: 29 (1.30%)
...
- names::n3: 9 (0.51%)
- names::n0: 9 (0.51%)
- names::A: 8 (0.45%)
- names$A0: 8 (0.45%)
- names$A1: 8 (0.45%)
- names$A: 7 (0.39%)
- names1>: 7 (0.39%)
- names1: 6 (0.34%)
- names>: 6 (0.34%)
- names: 5 (0.28%)
+ names::n3: 9 (0.40%)
+ names::n0: 9 (0.40%)
+ names::A: 8 (0.35%)
+ names$A0: 8 (0.35%)
+ names$A1: 8 (0.35%)
+ names$A: 7 (0.31%)
+ names1>: 7 (0.31%)
+ names1: 6 (0.26%)
+ names>: 6 (0.26%)
+ names: 5 (0.22%)
# All entities
names MPackage names Group of modules used to test various full_name configurations and conflicts.
names$Object MClassDef names/n0.nit:20,1--22,3 Root interface
names::Object::init MMethod names/n0.nit:20,1--22,3
names$Object$init MMethodDef names/n0.nit:20,1--22,3
+names::Object::defaultinit MMethod names/n0.nit:20,1--22,3
+names$Object$defaultinit MMethodDef names/n0.nit:20,1--22,3
names::A MClass names/n0.nit:24,1--31,3 A public class
names$A MClassDef names/n0.nit:24,1--31,3 A public class
names::A::a MMethod names/n0.nit:26,2--27,13 A public method in a public class
names$A$a MMethodDef names/n0.nit:26,2--27,13 A public method in a public class
names::n0::A::z MMethod names/n0.nit:29,2--30,21 A private method in a public class
names$A$z MMethodDef names/n0.nit:29,2--30,21 A private method in a public class
+names::A::defaultinit MMethod names/n0.nit:24,1--31,3
+names$A$defaultinit MMethodDef names/n0.nit:24,1--31,3
names::A0 MClass names/n0.nit:33,1--46,3 A public subclass in the same module
names$A0 MClassDef names/n0.nit:33,1--46,3 A public subclass in the same module
names$A0$A::a MMethodDef names/n0.nit:38,2--39,19 Redefinition it the same module of a public method
names$A0$::n0::A::z MMethodDef names/n0.nit:41,2--42,19 Redefinition it the same module of a private method
names$A0$::n0::P::p MMethodDef names/n0.nit:44,2--45,19 Redefinition it the same module of a private method
+names::A0::defaultinit MMethod names/n0.nit:33,1--46,3
+names$A0$defaultinit MMethodDef names/n0.nit:33,1--46,3
names::n0::P MClass names/n0.nit:48,1--52,3 A private class
names::n0$P MClassDef names/n0.nit:48,1--52,3 A private class
names::n0::P::p MMethod names/n0.nit:50,2--51,13 A private method in a private class
names::n0$P$p MMethodDef names/n0.nit:50,2--51,13 A private method in a private class
+names::P::defaultinit MMethod names/n0.nit:48,1--52,3
+names::n0$P$defaultinit MMethodDef names/n0.nit:48,1--52,3
names::n0::P0 MClass names/n0.nit:54,1--67,3 A private subclass introduced in the same module
names::n0$P0 MClassDef names/n0.nit:54,1--67,3 A private subclass introduced in the same module
names::n0$P0$A::a MMethodDef names/n0.nit:59,2--60,19 Redefinition it the same module of a public method
names::n0$P0$::n0::A::z MMethodDef names/n0.nit:62,2--63,19 Redefinition it the same module of a private method
names::n0$P0$::n0::P::p MMethodDef names/n0.nit:65,2--66,19 Redefinition it the same module of a private method
+names::P0::defaultinit MMethod names/n0.nit:54,1--67,3
+names::n0$P0$defaultinit MMethodDef names/n0.nit:54,1--67,3
names::n1 MModule names/n1.nit:15,1--90,3 Second module
names::n1$A MClassDef names/n1.nit:20,1--30,3 A refinement of a class
names::n1$A$a MMethodDef names/n1.nit:22,2--23,19 A refinement in the same class
names$A1$A::a MMethodDef names/n1.nit:49,2--50,19 A redefinition in a subclass from a different module
names$A1$::n0::A::z MMethodDef names/n1.nit:52,2--53,19 A redefinition in a subclass from a different module
names$A1$::n0::P::p MMethodDef names/n1.nit:55,2--56,19 A redefinition in a subclass from a different module
+names::A1::defaultinit MMethod names/n1.nit:44,1--57,3
+names$A1$defaultinit MMethodDef names/n1.nit:44,1--57,3
names::n1$::n0::P MClassDef names/n1.nit:59,1--63,3 A refinement of a class
names::n1$::n0::P$p MMethodDef names/n1.nit:61,2--62,19 A refinement in the same class
names::n1$::n0::P0 MClassDef names/n1.nit:65,1--75,3 A refinement of a subclass
names::n1$P1$A::a MMethodDef names/n1.nit:82,2--83,19 A redefinition in a subclass from a different module
names::n1$P1$::n0::A::z MMethodDef names/n1.nit:85,2--86,19 A redefinition in a subclass from a different module
names::n1$P1$::n0::P::p MMethodDef names/n1.nit:88,2--89,19 A redefinition in a subclass from a different module
+names::P1::defaultinit MMethod names/n1.nit:77,1--90,3
+names::n1$P1$defaultinit MMethodDef names/n1.nit:77,1--90,3
names::n2 MModule names/n2.nit:15,1--33,3 A alternative second module, used to make name conflicts
names::n2$A MClassDef names/n2.nit:20,1--27,3 A refinement of a class
names::n2::A::b MMethod names/n2.nit:22,2--23,13 Name conflict? A second public method
names::n2$P MClassDef names/n2.nit:29,1--33,3 Name conflict? A second private class
names::n2::P::p MMethod names/n2.nit:31,2--32,13 Name conflict? A private method in an homonym class.
names::n2$P$p MMethodDef names/n2.nit:31,2--32,13 Name conflict? A private method in an homonym class.
+names::P::defaultinit!CONFLICT!MMethod MMethod names/n2.nit:29,1--33,3
+names::n2$P$defaultinit MMethodDef names/n2.nit:29,1--33,3
names1 MPackage names1.nit An alternative second module in a distinct package
names1> MGroup names1.nit An alternative second module in a distinct package
names1::names1 MModule names1.nit:15,1--90,3 An alternative second module in a distinct package
names1$A1$names::A::a MMethodDef names1.nit:49,2--50,19 A redefinition in a subclass from a different module
names1$A1$names::n0::A::z MMethodDef names1.nit:52,2--53,19 A redefinition in a subclass from a different module
names1$A1$names::n0::P::p MMethodDef names1.nit:55,2--56,19 A redefinition in a subclass from a different module
+names1::A1::defaultinit MMethod names1.nit:44,1--57,3
+names1$A1$defaultinit MMethodDef names1.nit:44,1--57,3
names1::names1$names::n0::P MClassDef names1.nit:59,1--63,3 A refinement of a class
names1::names1$names::n0::P$p MMethodDef names1.nit:61,2--62,19 A refinement in the same class
names1::names1$names::n0::P0 MClassDef names1.nit:65,1--75,3 A refinement of a subclass
names1::names1$P1$names::A::a MMethodDef names1.nit:82,2--83,19 A redefinition in a subclass from a different module
names1::names1$P1$names::n0::A::z MMethodDef names1.nit:85,2--86,19 A redefinition in a subclass from a different module
names1::names1$P1$names::n0::P::p MMethodDef names1.nit:88,2--89,19 A redefinition in a subclass from a different module
+names1::P1::defaultinit MMethod names1.nit:77,1--90,3
+names1::names1$P1$defaultinit MMethodDef names1.nit:77,1--90,3
Alcoholic Bool Career Character Combatable Dwarf Elf Float Game Human Int List Magician Object Race Starter String Sys Warrior Weapon
# mproperties:
-!= * * + + - - / / == > > OTHER _age _base_endurance _base_intelligence _base_strength _career _endurance_bonus _health _intelligence_bonus _name _race _sex _strength_bonus age age= attack base_endurance base_endurance= base_intelligence base_intelligence= base_strength base_strength= career career= computer_characters defend direct_attack dps endurance_bonus endurance_bonus= health health= hit_points init intelligence_bonus intelligence_bonus= is_dead main max_health name name= pause_game player_characters quit race race= sex sex= start start_game stop_game strength_bonus strength_bonus= to_f total_endurance total_intelligence total_strengh unary -
+!= * * + + - - / / == > > OTHER _age _base_endurance _base_intelligence _base_strength _career _endurance_bonus _health _intelligence_bonus _name _race _sex _strength_bonus age age= attack base_endurance base_endurance= base_intelligence base_intelligence= base_strength base_strength= career career= computer_characters defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defend direct_attack dps endurance_bonus endurance_bonus= health health= hit_points init intelligence_bonus intelligence_bonus= is_dead main max_health name name= pause_game player_characters quit race race= sex sex= start start_game stop_game strength_bonus strength_bonus= to_f total_endurance total_intelligence total_strengh unary -
------------------------------------
-!= * * + + - - / / == > > OTHER _age _base_endurance _base_intelligence _base_strength _career _endurance_bonus _health _intelligence_bonus _name _race _sex _strength_bonus age age= attack base_endurance base_endurance= base_intelligence base_intelligence= base_strength base_strength= career career= computer_characters defend direct_attack dps endurance_bonus endurance_bonus= health health= hit_points init intelligence_bonus intelligence_bonus= is_dead main max_health name name= pause_game player_characters quit race race= sex sex= start start_game stop_game strength_bonus strength_bonus= to_f total_endurance total_intelligence total_strengh unary -
+!= * * + + - - / / == > > OTHER _age _base_endurance _base_intelligence _base_strength _career _endurance_bonus _health _intelligence_bonus _name _race _sex _strength_bonus age age= attack base_endurance base_endurance= base_intelligence base_intelligence= base_strength base_strength= career career= computer_characters defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defaultinit defend direct_attack dps endurance_bonus endurance_bonus= health health= hit_points init intelligence_bonus intelligence_bonus= is_dead main max_health name name= pause_game player_characters quit race race= sex sex= start start_game stop_game strength_bonus strength_bonus= to_f total_endurance total_intelligence total_strengh unary -
# msignatures:
!=(other: OTHER): Bool
-*(f: Float): Float
*(i: Int): Int
+*(f: Float): Float
+(f: Float): Float
+(i: Int): Int
-(i: Int): Int
-(f: Float): Float
-/(f: Float): Float
/(i: Int): Int
+/(f: Float): Float
==(other: OTHER): Bool
->(f: Float): Bool
>(i: Int): Bool
+>(f: Float): Bool
age: Int
age=(age: Int)
attack(target: Combatable, weapon: Weapon): Int
career: nullable Career
career=(career: nullable Career)
computer_characters: List[Character]
+defaultinit
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit
+defaultinit
+defaultinit
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit
+defaultinit
+defaultinit
+defaultinit
+defaultinit
+defaultinit(race: Race, name: String, age: Int, sex: Bool)
+defaultinit
+defaultinit
defend(hit: Int): Int
direct_attack(target: Combatable, weapon: Weapon): Int
dps: Float
unary -: Int
------------------------------------
!=(other: OTHER): Bool
-*(f: Float): Float
*(i: Int): Int
+*(f: Float): Float
+(f: Float): Float
+(i: Int): Int
-(i: Int): Int
-(f: Float): Float
-/(f: Float): Float
/(i: Int): Int
+/(f: Float): Float
==(other: OTHER): Bool
->(f: Float): Bool
>(i: Int): Bool
+>(f: Float): Bool
age: Int
age=(age: Int)
attack(target: Combatable, weapon: Weapon): Int
career: nullable Career
career=(career: nullable Career)
computer_characters: List[Character]
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit
+defaultinit
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit
+defaultinit
+defaultinit(base_strength, base_endurance, base_intelligence: Int)
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit(strength_bonus, endurance_bonus, intelligence_bonus: Int)
+defaultinit
+defaultinit
+defaultinit
+defaultinit
+defaultinit
+defaultinit(race: Race, name: String, age: Int, sex: Bool)
+defaultinit
+defaultinit
defend(hit: Int): Int
direct_attack(target: Combatable, weapon: Weapon): Int
dps: Float
I have 2 modules
I have 7 classes
For 7 definitions of classes
-I have 15 methods
-For 17 definitions of methods
+I have 18 methods
+For 20 definitions of methods
print "baz{self}"
return self
end
+
+ redef fun to_s
+ do
+ # cname without generics (for erasure compiler)
+ var cname = class_name.split('[')[0]
+ return "<{cname}>"
+ end
end
class Y
x = &(foo.bar).baz
var y = new Y
-#_lt1#x = &y # error since y is a variable TODO: put `alt1` back
+#alt1#x = &y # error since y is a variable
x = &y.foo
x = &y.foo.bar
x = &y.foo.bar.baz
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import functional
+
+redef class Object
+ fun toto(x: Int): Int
+ do
+ return x + 1
+ end
+end
+
+redef class Int
+ redef fun toto(x) do return x + self
+
+ fun mult_by(x: Int): Int do return x * self
+end
+
+class A
+ fun fun1: String
+ do
+ return "in A::fun1"
+ end
+end
+
+class B
+ super A
+
+ redef fun fun1
+ do
+ return "in B::fun1"
+ end
+end
+
+class Counter
+ var x = 0
+ fun incr do x += 1
+end
+
+class C[E]
+ var x: E
+ redef fun to_s
+ do
+ if x != null then
+ return "x is {x.as(not null)}"
+ end
+ return "x is null"
+ end
+
+ fun bar: C[E] do return self
+ fun foo: Fun0[C[E]] do return &bar
+end
+
+var a = new A
+var b: A = new B
+
+var f1 = &a.fun1
+print f1.call # "in A::fun1"
+
+var f2 = &b.fun1
+print f2.call # "in B::fun1"
+
+var f3 = &10.mult_by
+print f3.call(10) # 100
+
+var f4 = &f2.call
+print f4.call # "in B::fun1"
+
+var f5: Fun0[Object] = &f4.call
+print f5.call
+print f5.call
+
+print((&10.toto).call(100)) # 110
+print((&"allo".toto).call(2)) # 3
+
+var cnt = new Counter
+var p1 = &cnt.incr
+var ps = [p1,p1,p1,p1,p1]
+
+for p in ps do p.call
+print cnt.x # 5
+
+var c1 = new C[nullable Object](null)
+var c2 = new C[nullable Int](null)
+
+var f6 = &c1.to_s
+var f7 = &c2.to_s
+
+print f6.call # "x is null"
+print f7.call # "x is null"
+
+c1.x = "test"
+c2.x = 100
+
+print f6.call # "x is test"
+print f7.call # "x is 100"
+
+var f8 = c2.foo
+print f8.call # "x is 100"
# Run some tests on each engine
-engine=(nitcg nitcg nitcs nitcsg nitce niti nitvm)
+engine=(nitcg nitcg nitcs nitcsg nitce niti)
if uname | grep MINGW64 1>/dev/null 2>&1; then
engine=(nitcg nitcg nitcs nitcsg nitce)
fi