scalameta / scalagen

WIP - Scalameta powered code generation
Apache License 2.0
40 stars 5 forks source link

Post transformation validation #15

Closed DavidDudson closed 6 years ago

DavidDudson commented 6 years ago

The main one is to ensure there are no namespace collisions.

For example, if a generator generates a companion object, but there already is one.

Or if a generator generates a toString, but there already is one. etc.

Simple, quick validation, that can minimize the need to do a full compile to find problems.

olafurpg commented 6 years ago

For example, if a generator generates a companion object, but there already is one. Or if a generator generates a toString, but there already is one. etc.

I suspect it's better to leave this to the scala compiler to figure out, otherwise we'll probably end up implementing a half-baked, bug ridden typechecker. Incompatibilities like these between generators are also unlikely to resurface once the first bugs are ironed out.

DavidDudson commented 6 years ago

Closing this for now. I agree with @olafurpg