Introduce 'mayHaveContract'-flag in stubs
This is needed for further commit, which supports contracts-based smartcasts in partial body resolve mode. NB: Stubs can be built from 3 sources: - source code (contract presence can be checked by PSI) - binary data (contract presence can be checked by Kotlin Metadata) - decompiled sources The last case is a bit of a headache, because usually bodies are omitted in decompiled sources. To workaround it, we have to inject stubbed contract-call in the body.
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
PsiJetFileStubImpl[package=test]
|
||||
FILE_ANNOTATION_LIST
|
||||
ANNOTATION_ENTRY[hasValueArguments=true, shortName=Suppress]
|
||||
ANNOTATION_TARGET[useSiteTarget=FILE]
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=Suppress]
|
||||
PACKAGE_DIRECTIVE
|
||||
REFERENCE_EXPRESSION[referencedName=test]
|
||||
IMPORT_LIST
|
||||
IMPORT_DIRECTIVE[importedFqName=kotlin.internal.contracts, isAllUnder=true, isValid=true]
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=internal]
|
||||
REFERENCE_EXPRESSION[referencedName=contracts]
|
||||
FUN[fqName=test.myRequire, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=true, name=myRequire]
|
||||
VALUE_PARAMETER_LIST
|
||||
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x]
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=Boolean]
|
||||
Reference in New Issue
Block a user