You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we load symbols, in some cases we over-approximate and create symbols that don't really exist. These should be later on marked as absent, i.e. their denots should have their info set to NoType. This doesn't correctly work when using Tasty Inspector.
It is possible to find symbols either by asking for them by name, or by listing members of definitions (say, of a package) that have a denot with info still set to NoCompleter. Nearly any operation on such symbols will cause a crash.
Demo and affected code
#10451 will demonstrate an exception when it finishes.
Another good place to mark the symbols as absent would be the ReadTasty class, which is responsible for forcing symbols when loading them for Tasty Inspector.
@nicolasstucki asking before I forget. Do you think we have to fix this for RC1? It seems like a serious bug to leave for the release, though fixing it will be painful as well.
Short summary
When we load symbols, in some cases we over-approximate and create symbols that don't really exist. These should be later on marked as absent, i.e. their denots should have their info set to NoType. This doesn't correctly work when using Tasty Inspector.
It is possible to find symbols either by asking for them by name, or by listing members of definitions (say, of a package) that have a denot with info still set to NoCompleter. Nearly any operation on such symbols will cause a crash.
Demo and affected code
#10451 will demonstrate an exception when it finishes.
Doctool is affected, as it needs to look up definitions for definition-link-resolving purposes. At the moment, we circumvent this by checking if a symbol is complete (see https://github.com/lampepfl/dotty/blob/master/scala3doc/src/dotty/dokka/tasty/comments/MemberLookup.scala#L62-L78).
Any code that tries to use Tasty Inspector for definition lookup will probably be affected as well.
Potential fixes
I tried to fix this by marking still-incomplete symbols as absent in https://github.com/lampepfl/dotty/blob/master/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala#L870-L874. This resulted in exceptions being thrown when bootstrapping the compiler, though I don't know whether that can be fixed further or not.
Another good place to mark the symbols as absent would be the ReadTasty class, which is responsible for forcing symbols when loading them for Tasty Inspector.
/cc @nicolasstucki @smarter @odersky
The text was updated successfully, but these errors were encountered: