import kernel
class A
- var _i: Int
+ var i: Int
redef fun output do _i.output
init(i: Int) do _i = i
end
end
class Foo
- var _a1: Int
- var _a2: Int
+ var a1: Int
+ var a2: Int
fun run
do
_a1.output
class Bar
super Foo
- var _a3: Int
+ var a3: Int
redef fun run
do
_a1.output
protected var a11: Object private writable = self
private var a12: Object private writable = self
- var _cpt: Int = 0
+ var cpt: Int = 0
redef fun output
do
class Int
end
class A
- var _i: Int = 1
+ var i: Int = 1
end
end
class Integer
- var _val: Int
+ var val: Int
init(val: Int) do _val = val
fun output do _val.output
end
class Foo
- var _a1: Integer
- var _a2: Integer
+ var a1: Integer
+ var a2: Integer
fun run
do
_a1.output
class Bar
super Foo
- var _a3: Integer#alt1# #alt2#
- #alt1#var _a3: Integer = new Integer(9000)
- #alt2#var _a3: nullable Integer
+ var a3: Integer#alt1# #alt2#
+ #alt1#var a3: Integer = new Integer(9000)
+ #alt2#var a3: nullable Integer
redef fun run
do
_a1.output
end
class Integer
- var _val: Int
+ var val: Int
init(val: Int) do _val = val
fun output do _val.output
end
class Foo
- var _a1: Integer
- var _a2: Integer
+ var a1: Integer
+ var a2: Integer
fun run
do
_a1.output
class Bar
super Foo
- var _a3: Integer
+ var a3: Integer
redef fun run
do
_a1.output
end
class Foo
- var _a1: Int
- var _a2: Int
+ var a1: Int
+ var a2: Int
fun run
do
_a1.output
class Bar
super Foo
- var _a3: Int
+ var a3: Int
redef fun run
do
_a1.output
import kernel
class Client
- var _budjet: Int #
+ var budjet: Int #
fun regarde(t: Tableau)
do
if t.joli and dans_mes_moyens(t.etiquette.prix) then
class B[E]
redef fun output do _e.output
- var _e: E
+ var e: E
init(e: E) do _e = e
end
_f.output
_g.output
end
- var _f: F
- var _g: G
+ var f: F
+ var g: G
init(f: F, g: G)
do
_f = f
import kernel
class A
- var _i: Int
+ var i: Int
init (i: Int) do _i = i
redef fun output do _i.output
end
import kernel
class A
- var _i: nullable Int = null
- var _b: nullable Bool = null
- var _c: nullable Char = null
+ var i: nullable Int = null
+ var b: nullable Bool = null
+ var c: nullable Char = null
init
do
import kernel
class A
- var _foo: Int = 1
+ var foo: Int = 1
fun +(i: Int): A do return new A
redef fun output do 1.output
end
import kernel
class G[A: nullable Object]
- var _a: A
+ var a: A
init (a: A) do _a = a
fun run
class A[E]
type T: E
- var _t: T
+ var t: T
fun foo(t: T) do end
fun foo2: T do return _t
fun bar(t: A[T]) do end
class A
super Elt
- var _a: Int
+ var a: Int
redef fun val1: Int do return _a
init(i: Int) do _a = i
class Elt2
super Elt
- var _b: Int
+ var b: Int
redef fun val1: Int do return _b/2
redef fun val2: Int do return _b
init initelt2(i: Int) do _b = i
class C
super Elt
- var _c: Int
- var _d: Int
+ var c: Int
+ var d: Int
redef fun val1: Int do return _c end
redef fun val2: Int do return _d end
_is_val1 = not _is_val1
end
- var _is_val1: Bool = false
+ var is_val1: Bool = false
init do end
end
do
return _name
end
- var _name: String = "noname"
+ var name: String = "noname"
end
class WakeUpNode
do
_scheduler.add_event(self, d)
end
- var _scheduler: Scheduler
+ var scheduler: Scheduler
init do end
end
class NodeSource
super Node
- var _nexts: nullable ArraySet[NodeSink] = null
+ var nexts: nullable ArraySet[NodeSink] = null
fun attach(n: NodeSink)
# Add the sink `n' the the connected nodes
# Do nothing if `n' is already connected
#
class Scheduler
- var _time_list: Array[Couple[Int, WakeUpNode]] = new Array[Couple[Int, WakeUpNode]]
- var _time: Int = 0 # What time is it ?
+ var time_list: Array[Couple[Int, WakeUpNode]] = new Array[Couple[Int, WakeUpNode]]
+ var time: Int = 0 # What time is it ?
fun add_event(n: WakeUpNode, d: Int)
# The node `n' whant to be weaked up in `d' time units
do
send
wake_up_in(_delay)
end
- var _delay: Int
+ var delay: Int
fun start
do
wake_up_in(_delay)
class NodeAlternate
super NodeSink
super NodeSource
- var _last: nullable NodeSource
+ var last: nullable NodeSource
redef fun recieve(n: NodeSource)
do
if n != _last then
class NodeEat
super CountSink
super NodeSource
- var _limit: Int
+ var limit: Int
redef fun recieve(n: NodeSource)
do
var c = count + 1
super NodeSource
super NodeSink
super WakeUpNode
- var _delay: Int
+ var delay: Int
redef fun recieve(n: NodeSource)
do
wake_up_in(_delay)
# limitations under the License.
class A
- var _toto: Int
- var _toto: Object
+ var toto: Int
+ var toto: Object
end
# limitations under the License.
class A
- var _toto: Int
+ var toto: Int
fun m
do
_toto = 't'
class A
- var _x: Object = fail
- var _i: Int = 1
+ var x: Object = fail
+ var i: Int = 1
fun y do fail
fun z: Object do return fail
fun t do
# limitations under the License.
class A[T]
- var _k: T[Int]
+ var k: T[Int]
end
# limitations under the License.
redef class Object
- var _toto: Bool
+ var toto: Bool
end
# limitations under the License.
redef class Int
- var _toto: Object
+ var toto: Object
end
import module_simple
redef class C
- redef var _a: Int
+ redef var a: Int
end
# limitations under the License.
class A
- var _a: Int = 1
+ var a: Int = 1
end
class B
super A
- redef var _a: Object = 2
+ redef var a: Object = 2
end
_quantity = i
end
- var _quantity: Int
+ var quantity: Int
end
var i = 99
end
end
- var _t: Array[Int] # The stack of discus (only the diameter is stored).
+ var t: Array[Int] # The stack of discus (only the diameter is stored).
init full(n: Int)
# Build a new tower with `n' discus.
return "{_tower1} {_tower2} {_tower3}"
end
- var _tower1: Tower
- var _tower2: Tower
- var _tower3: Tower
+ var tower1: Tower
+ var tower2: Tower
+ var tower3: Tower
init(nb: Int)
do
# receveur ("self")
# Les attributs sont déclarés par le mot clé "fun" et commencent par un "@"
- var _nom_: String # Un entrepôt a un nom (de type chaîne).
- var _rayons: Array[Rayon] # Il est composé d'un ensemble de rayon.
+ var nom_: String # Un entrepôt a un nom (de type chaîne).
+ var rayons: Array[Rayon] # Il est composé d'un ensemble de rayon.
# "Array" est une classe paramétrée, les crochets en sont la marque.
# La classe "Rayon" est définie plus loin
class Produit
private
- var _nom_: String # Désignation du produit
- var _qte_: Int # Quantité en stock
+ var nom_: String # Désignation du produit
+ var qte_: Int # Quantité en stock
class Rayon
private
- var _stock: Array[Produit] # Des produits en stock
- var _rubrique: String # La catégorie des produits stockés
+ var stock: Array[Produit] # Des produits en stock
+ var rubrique: String # La catégorie des produits stockés
# Cette fonction est utilisé par to_s pour afficher un petit titre
fun to_s_head: String
return _temp_max_ # Attribut défini juste en dessous
end
- var _temp_max_: Int # Une température maximale
+ var temp_max_: Int # Une température maximale
# Les autres attributs sont bien sûr hérités !
redef fun to_s_head: String # On redéfinit cette méthode
class Point
private
- var _x: Int # Abscisse
- var _y: Int # Ordonnée
-
-
- fun x: Int
- do
- return _x
- end
- fun x=(i: Int)
- do
- _x = i
- end
-
- fun y: Int
- do
- return _y
- end
- fun y=(i: Int)
- do
- _y = i
- end
+ var x: Int # Abscisse
+ var y: Int # Ordonnée
# Change la position d'un point
fun moveto(x: Int, y: Int)
import kernel
class Client
- var _credit: Int
+ var credit: Int
fun regarde(t: Tableau)
do
# * try to change the optimization flags
# * try to update your gcc version
class Foo
- var _count: Int = 0
+ var count: Int = 0
fun run: Int
do
# Under some case gcc produce bad code here and make the if
super B
fun r(x: B) do end
fun s: B do return self end
- var _a: B
+ var a: B
end
import kernel
class A
var foo: Int = 1
- var _foo: Int = 2
+ var bar: Int = 2
end
var a: nullable A = null
#alt1#a.foo.output
#alt2#a.foo = 1
#alt3#a.foo += 1
-#alt4#a._foo.output
-#alt5#a._foo = 10
-#alt6#a._foo += 10
+#alt4#a._bar.output
+#alt5#a._bar = 10
+#alt6#a._bar += 10
alt/base_attr5_alt17.nit:47,12--14: Error: No property B::bar is inherited. Remove the redef keyword to define a new property.
-alt/base_attr5_alt17.nit:47,12--14: Error: Untyped attribute base_attr5_alt17#B#@bar
+alt/base_attr5_alt17.nit:47,12--14: Error: Untyped attribute base_attr5_alt17#B#_bar
-Runtime error: Uninitialized attribute @e (alt/base_attr_gen_alt1.nit:26)
+Runtime error: Uninitialized attribute _e (alt/base_attr_gen_alt1.nit:26)
-error_attr_2def.nit:19,6--10: Error: A property _toto is already defined in class A at line 18.
+error_attr_2def.nit:19,6--9: Error: A property toto is already defined in class A at line 18.
-error_expr_not_ok.nit:19,19--22: Error: Method or variable 'fail' unknown in A.
+error_expr_not_ok.nit:19,18--21: Error: Method or variable 'fail' unknown in A.
error_expr_not_ok.nit:21,11--14: Error: Method or variable 'fail' unknown in A.
error_expr_not_ok.nit:22,26--29: Error: Method or variable 'fail' unknown in A.
error_expr_not_ok.nit:24,8--11: Error: Method or variable 'fail' unknown in A.
-alt/error_expr_not_ok_alt2.nit:19,19--22: Error: Method or variable 'fail' unknown in A.
+alt/error_expr_not_ok_alt2.nit:19,18--21: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt2.nit:21,11--14: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt2.nit:22,26--29: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt2.nit:24,8--11: Error: Method or variable 'fail' unknown in A.
-alt/error_expr_not_ok_alt3.nit:19,19--22: Error: Method or variable 'fail' unknown in A.
+alt/error_expr_not_ok_alt3.nit:19,18--21: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt3.nit:21,11--14: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt3.nit:22,26--29: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt3.nit:24,8--11: Error: Method or variable 'fail' unknown in A.
-alt/error_expr_not_ok_alt4.nit:19,19--22: Error: Method or variable 'fail' unknown in A.
+alt/error_expr_not_ok_alt4.nit:19,18--21: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt4.nit:21,11--14: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt4.nit:22,26--29: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt4.nit:24,8--11: Error: Method or variable 'fail' unknown in A.
-alt/error_expr_not_ok_alt5.nit:19,19--22: Error: Method or variable 'fail' unknown in A.
+alt/error_expr_not_ok_alt5.nit:19,18--21: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt5.nit:21,11--14: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt5.nit:22,26--29: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt5.nit:24,8--11: Error: Method or variable 'fail' unknown in A.
-alt/error_expr_not_ok_alt6.nit:19,19--22: Error: Method or variable 'fail' unknown in A.
+alt/error_expr_not_ok_alt6.nit:19,18--21: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt6.nit:21,11--14: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt6.nit:22,26--29: Error: Method or variable 'fail' unknown in A.
alt/error_expr_not_ok_alt6.nit:24,8--11: Error: Method or variable 'fail' unknown in A.
-error_formal.nit:18,10--14: Type error: formal type T cannot have formal parameters.
+error_formal.nit:18,9--13: Type error: formal type T cannot have formal parameters.
-error_kern_attr_any.nit:18,6--10: Error: Attempt to define attribute _toto in the interface Object.
+error_kern_attr_any.nit:18,6--9: Error: Attempt to define attribute toto in the interface Object.
-error_kern_attr_int.nit:18,6--10: Error: Attempt to define attribute _toto in the interface Int.
+error_kern_attr_int.nit:18,6--9: Error: Attempt to define attribute toto in the interface Int.
-error_ref_attr.nit:20,16--18: Redef Error: Wrong static type. found Int, expected B.
+error_ref_attr.nit:20,15--17: Redef Error: Wrong return type. found Int, expected B.
-error_spe_attr.nit:22,16--21: Redef Error: Wrong static type. found Object, expected Int.
+error_spe_attr.nit:22,15--20: Redef Error: Wrong return type. found Object, expected Int.
+error_spe_attr.nit:22,15--20: Redef Error: Wrong type for parameter `a'. found Object, expected Int.
-Runtime error: Uninitialized attribute @j (alt/base_attr_init_val_raf_alt1.nit:24)
+Runtime error: Uninitialized attribute _j (alt/base_attr_init_val_raf_alt1.nit:24)
1
1
-Runtime error: Uninitialized attribute @a (alt/rterror_attr_def_alt2.nit:26)
+Runtime error: Uninitialized attribute _a (alt/rterror_attr_def_alt2.nit:26)
-Runtime error: Uninitialized attribute @a (alt/rterror_attr_def_alt7.nit:49)
+Runtime error: Uninitialized attribute _a (alt/rterror_attr_def_alt7.nit:49)
c
</span></span><span class="line" id="L32"><span class="nc_k">end</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_def nc_t popupable" title="class B" data-title="<a href="base_simple3.html#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.html#base_simple3#Object">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_def nc_i popupable" title="base_simple3#B#val" data-title="<a href="base_simple3.html#base_simple3#B#val">base_simple3#B#val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">Int</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_def nc_i popupable" title="base_simple3#B#val" data-title="<a href="base_simple3.html#base_simple3#B#val">base_simple3#B#val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">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">init</span><span>(</span><span class="nc_v nc_i popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">7</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">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_def nc_t popupable" title="class C" data-title="<a href="base_simple3.html#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.html#base_simple3#Object">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_def nc_i popupable" title="base_simple3#C#val1" data-title="<a href="base_simple3.html#base_simple3#C#val1">base_simple3#C#val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">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_def nc_i popupable" title="base_simple3#C#val2" data-title="<a href="base_simple3.html#base_simple3#C#val2">base_simple3#C#val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">10</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_def nc_i popupable" title="base_simple3#C#val1" data-title="<a href="base_simple3.html#base_simple3#C#val1">base_simple3#C#val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">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_def nc_i popupable" title="base_simple3#C#val2" data-title="<a href="base_simple3.html#base_simple3#C#val2">base_simple3#C#val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">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="line" id="L48">
</span><span class="nc_pdef foldable" id="base_simple3#Object#foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3#Object#foo" data-title="<a href="base_simple3.html#base_simple3#Object#foo">base_simple3#Object#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.html#base_simple3#Int">Int</a>" data-content="<div><b>class</b> <span><a href="base_simple3.html#base_simple3#Int">Int</a></span><br/></div>" data-toggle="popover">2</span><span>.</span><span class="nc_i popupable" title="call base_simple3#Int#output" data-title="<a href="base_simple3.html#base_simple3#Int#output">call base_simple3#Int#output</a>" data-content="<div><b>call</b> <span><a href="base_simple3.html#base_simple3#Int#output">output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
std: 0.926
sum: 6
cnbp: number of accessible properties (inherited + local)
- avg: 4.0
- max: C (8)
+ avg: 5.0
+ max: C (10)
min: Object (3)
- std: 2.0
- sum: 34
+ std: 2.507
+ sum: 37
cnba: number of accessible attributes (inherited + local)
avg: 0.0
- max: Object (0)
+ max: C (2)
min: Object (0)
- std: 0.0
- sum: 0
+ std: 0.845
+ sum: 3
cnbip: number of introduced properties
avg: 2.0
- max: C (5)
+ max: C (7)
min: Bool (0)
- std: 1.69
- sum: 16
+ std: 2.42
+ sum: 19
cnbrp: number of redefined properties
avg: 0.0
max: Object (0)
sum: 6
cnbp: number of accessible properties (inherited + local)
avg: 4.0
- max: C (8)
+ max: C (10)
min: Object (1)
- std: 2.151
- sum: 35
+ std: 2.828
+ sum: 38
cnba: number of accessible attributes (inherited + local)
avg: 0.0
- max: Object (0)
+ max: C (2)
min: Object (0)
- std: 0.0
- sum: 0
+ std: 0.791
+ sum: 3
cnbip: number of introduced properties
avg: 2.0
- max: C (5)
+ max: C (7)
min: Bool (0)
- std: 1.62
- sum: 17
+ std: 2.291
+ sum: 20
cnbrp: number of redefined properties
avg: 0.0
max: Object (0)
`- group base_simple3
cnba: number of accessible attributes (inherited + local)
avg: 0.0
- max: Object (0)
+ max: C (2)
min: Object (0)
- std: 0.0
- sum: 0
+ std: 0.845
+ sum: 3
cnbna: number of accessible nullable attributes (inherited + local) -- nothing
sum: 0
## global metrics
cnba: number of accessible attributes (inherited + local)
avg: 0.0
- max: Object (0)
+ max: C (2)
min: Object (0)
- std: 0.0
- sum: 0
+ std: 0.791
+ sum: 3
cnbna: number of accessible nullable attributes (inherited + local) -- nothing
sum: 0
--- Sends on Nullable Receiver ---
-Runtime error: Uninitialized attribute @a (alt/rterror_attr_def_alt2.nit:24)
+Runtime error: Uninitialized attribute _a (alt/rterror_attr_def_alt2.nit:24)
-Runtime error: Uninitialized attribute @a (alt/rterror_attr_def_alt7.nit:24)
+Runtime error: Uninitialized attribute _a (alt/rterror_attr_def_alt7.nit:24)
c
-test_variance_attr.nit:28,21--32: Redef Error: Wrong static type. found nullable Int, expected nullable Object.
-test_variance_attr.nit:29,21--30: Redef Error: Wrong static type. found nullable B, expected nullable A.
+test_variance_attr.nit:28,20--31: Redef Error: Wrong type for parameter `foo'. found nullable Int, expected nullable Object.
+test_variance_attr.nit:29,20--29: Redef Error: Wrong type for parameter `bar'. found nullable B, expected nullable A.
# contributed by Jean Privat
class TreeNode
- var _left: nullable TreeNode
- var _right: nullable TreeNode
- var _item: Int
+ var left: nullable TreeNode
+ var right: nullable TreeNode
+ var item: Int
init(left: nullable TreeNode, right: nullable TreeNode, item: Int)
end
class Toto
- var _a: Int
+ var a: Int
redef fun output
do
printn(_a)
end
class Test
- var _t: Toto
+ var t: Toto
init
do
# limitations under the License.
class A
- var _attribute: nullable A
- var _num: Char
+ var attribute: nullable A
+ var num: Char
fun foo=(a: nullable A)
do
class Toto[E]
- var _item: E
+ var item: E
fun set(e: E)
do _item = e end
fun get: E
end
private
- var _tab: Array[Array[Int]] # An array of array to store items
+ var tab: Array[Array[Int]] # An array of array to store items
init
return "{first}:{_second}"
end
private
- var _first: F
- var _second: S
+ var first: F
+ var second: S
init(f: F, s: S)
do
# limitations under the License.
class A
- var _foo: nullable Object
- var _bar: nullable A
- var _baz: nullable Int
+ var foo: nullable Object
+ var bar: nullable A
+ var baz: nullable Int
redef fun output do 'A'.output end
init do end
class B
super A
- redef var _foo: nullable Int
- redef var _bar: nullable B
+ redef var foo: nullable Int
+ redef var bar: nullable B
redef fun output do 'B'.output end
init do end
var b = new B
var ab: A = b
-a._foo = a
-a._foo.output
-a._foo = b
-a._foo.output
-a._foo = 1
-a._foo.output
-a._bar = a
-a._bar.output
-a._bar = b
-a._bar.output
-a._baz = 1
-a._baz.output
+a.foo = a
+a.foo.output
+a.foo = b
+a.foo.output
+a.foo = 1
+a.foo.output
+a.bar = a
+a.bar.output
+a.bar = b
+a.bar.output
+a.baz = 1
+a.baz.output
-#ab._foo = a
-#ab._foo.output
-#ab._foo = b
-#ab._foo.output
-ab._foo = 1
-ab._foo.output
-#ab._bar = a
-#ab._bar.output
-ab._bar = b
-ab._bar.output
-ab._baz = 1
-ab._baz.output
+#ab.foo = a
+#ab.foo.output
+#ab.foo = b
+#ab.foo.output
+ab.foo = 1
+ab.foo.output
+#ab.bar = a
+#ab.bar.output
+ab.bar = b
+ab.bar.output
+ab.baz = 1
+ab.baz.output
-#b._foo = a
-#b._foo.output
-#b._foo = b
-#b._foo.output
-b._foo = 1
-b._foo.output
-#b._bar = a
-#b._bar.output
-b._bar = b
-b._bar.output
-b._baz = 1
-b._baz.output
+#b.foo = a
+#b.foo.output
+#b.foo = b
+#b.foo.output
+b.foo = 1
+b.foo.output
+#b.bar = a
+#b.bar.output
+b.bar = b
+b.bar.output
+b.baz = 1
+b.baz.output