lampepfl / dotty-feature-requests

Historical feature requests. Please create new feature requests at https://github.com/lampepfl/dotty/discussions/new?category=feature-requests
31 stars 2 forks source link

Invariant check: do all(non-array) selects & idents have symbols? #37

Open DarkDimius opened 8 years ago

DarkDimius commented 8 years ago

It used to be the case that before Splitter not all Select and Ident nodes had a symbol set. This was because of Or and And types. After Splitter distributed And and Or types, we had an invariant that all Select and Ident nodes had a symbol set. Since https://github.com/lampepfl/dotty/pull/1550 splitter no longer distributes it, as we stopped supporting those cases in typer.

Is it true now that all trees should have a proper symbol? Aside from introducing one more check to TreeCheker, this would allow us to joinElimByName(that relies on Idents&selects having symbol) phase-group with previous one.

odersky commented 6 years ago

It would be good to answer that question experimentally. Make a check and see whether it blows up.

smarter commented 6 years ago

I guess this is currently false because refinements can introduce new members and those don't get symbols: https://github.com/lampepfl/dotty/pull/3733