Stubs don't break KtTypeAlias::isTopLevel

`foo ?: bar is baz` is parsed as `(foo ?: bar) is baz`. So, if stub is non-null, this always returns `False`, because `Boolean` is definitely not a `KtFile`. See https://pl.kotl.in/6DtggcImf 

This Kotlin's "most vexing parse" badly needs a diagnostics.
This commit is contained in:
Aleksey Kladov
2019-11-24 21:32:27 +03:00
committed by Dmitry Petrov
parent 08454aa47e
commit 0aa527347d
@@ -33,7 +33,7 @@ class KtTypeAlias : KtTypeParameterListOwnerStub<KotlinTypeAliasStub>, KtNamedDe
visitor.visitTypeAlias(this, data)
fun isTopLevel(): Boolean =
stub?.isTopLevel() ?: parent is KtFile
stub?.isTopLevel() ?: (parent is KtFile)
@IfNotParsed
fun getTypeAliasKeyword(): PsiElement? =