/* Ċ Ġ* ĠCopyright Ġ 2 0 0 0 - 2 0 1 8 ĠJetBrains Ġs . r . o . Ġand ĠKotlin ĠProgramming ĠLanguage Ġcontributors . Ċ Ġ* ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe Ġlicense / LICENSE . txt Ġfile . Ċ Ġ*/ Ċ Ċ package Ġorg . jetbrains . kotlin . resolve Ċ Ċ import Ġorg . jetbrains . kotlin . descriptors .* Ċ import Ġorg . jetbrains . kotlin . name . Class Id Ċ import Ġorg . jetbrains . kotlin . name . Fq Name Ċ import Ġorg . jetbrains . kotlin . types . Kotlin Type Ċ import Ġorg . jetbrains . kotlin . types . Type Subst it utor Ċ import Ġorg . jetbrains . kotlin . types . Type Utils Ċ import Ġorg . jetbrains . kotlin . types . Variance Ċ import Ġorg . jetbrains . kotlin . utils . addTo Std lib . safe As Ċ Ċ val ĠJVM _ INLINE _ AN NOT ATION _ FQ _ NAME Ġ= ĠF q Name (" kotlin . jvm . Jvm Inline ") Ċ val ĠJVM _ INLINE _ AN NOT ATION _ CLASS _ ID Ġ= ĠClass Id . top Level ( JVM _ INLINE _ AN NOT ATION _ FQ _ NAME ) Ċ Ċ // ĠFIXME : ĠDeserial ized Class Descriptor Ġin Ġreflection Ġdo Ġnot Ġhave Ġ@ Jvm Inline Ġannotation , Ġthat Ġwe Ċ // ĠFIXME : Ġwould Ġlike Ġto Ġcheck Ġas Ġwell . Ċ fun ĠDeclaration Descriptor . is Inline Class (): ĠBoolean Ġ= Ġwhen Ġ{ ĊĠĠĠ Ġthis Ġ! is ĠClass Descriptor Ġ-> Ġfalse ĊĠĠĠ Ġis Inline Ġ-> Ġtrue ĊĠĠĠ Ġelse Ġ-> Ġis Value Ġ&& Ġun subst it uted Primary Constructor ?. value Parameters ?. size ?. let Ġ{ Ġit Ġ== Ġ 1 Ġ} Ġ?: Ġtrue Ċ } Ċ Ċ fun ĠDeclaration Descriptor . is Value Class (): ĠBoolean Ġ= ĊĠĠĠ Ġthis Ġis ĠClass Descriptor Ġ&& Ġis Value Ċ Ċ fun ĠDeclaration Descriptor . is Inline Or Value Class (): ĠBoolean Ġ= Ġis Inline Class () Ġ|| Ġis Value Class () Ċ Ċ fun ĠKotlin Type . un subst it uted Under lying Type (): ĠKotlin Type ? Ġ= ĊĠĠĠ Ġconstructor . declaration Descriptor . safe As < Class Descriptor >() ?. inline Class Representation ?. underlying Type Ċ Ċ fun ĠKotlin Type . un subst it uted Under lying Types (): ĠList < Kotlin Type > Ġ{ ĊĠĠĠ Ġval Ġdeclaration Descriptor Ġ= Ġconstructor . declaration Descriptor . safe As < Class Descriptor >() Ġ?: Ġreturn Ġempty List () ĊĠĠĠ Ġreturn Ġwhen Ġ{ ĊĠĠĠĠĠĠĠ Ġdeclaration Descriptor . is Inline Class () Ġ-> ĠlistOf NotNull ( un subst it uted Under lying Type ()) ĊĠĠĠĠĠĠĠ Ġdeclaration Descriptor . is Value Class () Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdeclaration Descriptor . un subst it uted Primary Constructor ?. value Parameters ?. map Ġ{ Ġit . type Ġ} Ġ?: Ġempty List () ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġempty List () ĊĠĠĠ Ġ} Ċ } ĊĊ Ċ fun ĠKotlin Type . is Inline ClassType (): ĠBoolean Ġ= Ġconstructor . declaration Descriptor ?. is Inline Class () Ġ?: Ġfalse Ċ Ċ fun ĠKotlin Type . subst it uted Under lying Type (): ĠKotlin Type ? Ġ= ĊĠĠĠ Ġun subst it uted Under lying Type ()?. let Ġ{ ĠType Subst it utor . create ( this ). substitute ( it , ĠVari ance . IN VARIANT ) Ġ} Ċ Ċ fun ĠKotlin Type . subst it uted Under lying Types (): ĠList < Kotlin Type ?> Ġ= ĊĠĠĠ Ġun subst it uted Under lying Types (). map Ġ{ ĠType Subst it utor . create ( this ). substitute ( it , ĠVari ance . IN VARIANT ) Ġ} Ċ Ċ fun ĠKotlin Type . is Recursive Inline Or Value ClassType (): ĠBoolean Ġ= ĊĠĠĠ Ġis Recursive Inline Or Value ClassType Inner ( hash Set Of ()) Ċ Ċ private Ġfun ĠKotlin Type . is Recursive Inline Or Value ClassType Inner ( visited : ĠHashSet < Classifier Descriptor >): ĠBoolean Ġ{ ĊĠĠĠ Ġval Ġtypes Ġ= Ġwhen Ġ( val Ġdescriptor Ġ= Ġconstructor . declaration Descriptor ?. original ?. take If Ġ{ Ġit . is Inline Or Value Class () Ġ}) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠClass Descriptor Ġ-> Ġif Ġ( descriptor . is Inline Or Value Class ()) Ġun subst it uted Under lying Types () Ġelse Ġempty List () ĊĠĠĠĠĠĠĠ Ġis ĠType Parameter Descriptor Ġ-> Ġdescriptor . upper Bounds ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġempty List () ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġtypes . any Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġclassifier Ġ= Ġit . constructor . declaration Descriptor ?. original Ġ?: Ġreturn @ any Ġfalse ĊĠĠĠĠĠĠĠ Ġ! visited . add ( classifier ) Ġ|| Ġit . is Recursive Inline Or Value ClassType Inner ( visited ). also Ġ{ Ġvisited . remove ( classifier ) Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠKotlin Type . is Nullable Under lying Type (): ĠBoolean Ġ{ ĊĠĠĠ Ġif Ġ(! is Inline ClassType ()) Ġreturn Ġfalse ĊĠĠĠ Ġval Ġunderlying Type Ġ= Ġun subst it uted Under lying Type () Ġ?: Ġreturn Ġfalse ĊĊĠĠĠ Ġreturn ĠType Utils . is Nullable Type ( underlying Type ) Ċ } Ċ Ċ fun ĠCallable Descriptor . is Getter Of Under lying Property Of Inline Class () Ġ= ĊĠĠĠ Ġthis Ġis ĠProperty Getter Descriptor Ġ&& Ġcorresponding Property . is Under lying Property Of Inline Class () Ċ Ċ fun ĠVariable Descriptor . is Under lying Property Of Inline Class (): ĠBoolean Ġ= ĊĠĠĠ Ġextension Receiver Parameter Ġ== Ġnull Ġ&& ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ( containing Declaration Ġas ? ĠClass Descriptor )?. inline Class Representation ?. underlying PropertyName Ġ== Ġthis . name Ċ