metaborg / mb-rep

Apache License 2.0
2 stars 4 forks source link

Replace C-style term type integer checks with TermType enum #22

Closed Virtlink closed 4 years ago

Virtlink commented 4 years ago

This PR:

This PR allows you to write switch on IStrategoTerm.getType() without having to prefix every case with IStrategoTerm, or having to do a static import for each member. In languages that support it (e.g., Kotlin), the compiler can detect that the switch-case is exhaustive. As enums are safely compared using reference equality, this PR will have no performance impact (comparing two pointers is the same as comparing two integers).

Related:

Virtlink commented 4 years ago

What's the Jenkinsfile for?

I think Gabriel added that to trigger a build, since the old triggers stopped working.