wollok icon indicating copy to clipboard operation
wollok copied to clipboard

Number attribute inferred as Any even though there is a default value and used in numeric operations

Open mmatos opened this issue 5 years ago • 2 comments

I just enabled the type system and was trying it out (I'm currently using Wollok 1.8) and noticed this: imagen

salud is inferred as Any even though it has a default value of 100 and is used like this: salud = 0.max(salud - danio * 2)

Then it was inferred as Number when I added:

method sinVida() = salud == 0

mmatos avatar Jul 31 '19 13:07 mmatos

Esto no lo puedo replicar :(

PalumboN avatar Sep 14 '19 18:09 PalumboN

Related https://github.com/uqbar-project/wollok/issues/1757

PalumboN avatar Mar 09 '21 00:03 PalumboN