Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #159 singleton abstract methods #164

Merged
merged 5 commits into from
Sep 15, 2023

Conversation

fdodino
Copy link
Contributor

@fdodino fdodino commented Sep 11, 2023

Bueno, esto requiere varias partes: acá viene la parte del validador, para separarlo en otra tipificación.
De paso, creé una función para determinar si una clase hereda de otra custom (que no sea Object).

Para que pase el CI necesitamos mergear primero los tests de wollok-language que voy a crear ahora y van a estar asociados a este PR.

Copy link
Contributor

@ivojawer ivojawer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buenisimoo

src/validator.ts Outdated

const allParents = (module: Module) =>
module.supertypes.map(supertype => supertype.reference.target).flatMap(supertype => supertype?.hierarchy ?? [])

const inheritsCustom = (module: Module) => notEmpty(allParents(module).filter(element => element.name === baseClass))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 🔥

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm... está mal esta definición jajaja, es !==. Es decir hay que filtrar a Object de los parents, y ver que la lista no sea vacía.

@fdodino fdodino merged commit fc76461 into master Sep 15, 2023
2 checks passed
@fdodino fdodino deleted the fix-#159-singleton-abstract-methods branch September 15, 2023 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants