Open matifreyre opened 6 years ago
Puede que este haya sido un problema de cache? Yo lo acabo de probar en la versión 1.7.2 y me dice que la estrategia de despedidor es solamente de tipo despedir (como se espera).
En 1.7.7 todavía pasa. Si se invierten las definiciones de los saludadores o de las estrategias, funciona bien y determina un solo tipo de estrategia para cada saludador. Si se ponen en este orden: despedir, bienvenidor, despedidor, bienvenir, entonces ambos saludadores tienen el mismo problema.
Creo que esto se soluciona con https://github.com/uqbar-project/wollok/issues/1890
Working on version 1.7.1, the type-system seems to be erring somehow for the following piece of code. I'm not sure of what the rule should be, but it's following different rules for almost equal objects:
The types for both
estrategia
variables should be inferred equally (not the same type, but applying the same rules), either both should identify both objects that implementsaludar
(bienvenir
anddespedir
) or both should identify the specific object that implementssaludar
with code that can be evaluated usingself
as a parameter without syntax errors. Instead, the inferred types are the following:It can be seen that the types for
bienvenir
anddespedir
parameters onsaludar
are correct. I guess that's what is used when inferring onbienvenidor
, but not ondespedidor
.