/* Ċ Ġ* ĠCopyright Ġ 2 0 1 0 - 2 0 1 8 ĠJetBrains Ġs . r . o . Ġ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 . ir . types Ċ Ċ import Ġorg . jetbrains . kotlin . builtins . Kotlin Built Ins Ċ import Ġorg . jetbrains . kotlin . descriptors . Class Descriptor Ċ import Ġorg . jetbrains . kotlin . ir . symbols . Ir Class Symbol Ċ import Ġorg . jetbrains . kotlin . name . Fq Name Unsafe Ċ import Ġorg . jetbrains . kotlin . resolve . Descriptor Utils . getF q Name Ċ Ċ private Ġfun ĠIr Type . is BuiltIn ClassType ( descriptor Predicate : Ġ( Class Descriptor ) Ġ-> ĠBoolean , Ġhas Question Mark : ĠBoolean ): ĠBoolean Ġ{ ĊĠĠĠ Ġif Ġ( this Ġ! is ĠIr Simple Type ) Ġreturn Ġfalse ĊĠĠĠ Ġif Ġ( this . has Question Mark Ġ!= Ġhas Question Mark ) Ġreturn Ġfalse ĊĠĠĠ Ġval Ġclass Symbol Ġ= Ġthis . classifier Ġas ? ĠIr Class Symbol Ġ?: Ġreturn Ġfalse ĊĠĠĠ Ġreturn Ġdescriptor Predicate ( class Symbol . descriptor ) Ċ } Ċ Ċ private Ġfun ĠIr Type . isNotNull ClassType ( fq Name : ĠF q Name Unsafe ) Ġ= Ġis ClassType ( fq Name , Ġhas Question Mark Ġ= Ġfalse ) Ċ private Ġfun ĠIr Type . is Nullable ClassType ( fq Name : ĠF q Name Unsafe ) Ġ= Ġis ClassType ( fq Name , Ġhas Question Mark Ġ= Ġtrue ) Ċ Ċ private Ġfun ĠIr Type . is ClassType ( fq Name : ĠF q Name Unsafe , Ġhas Question Mark : ĠBoolean ): ĠBoolean Ġ{ ĊĠĠĠ Ġif Ġ( this Ġ! is ĠIr Simple Type ) Ġreturn Ġfalse ĊĠĠĠ Ġif Ġ( this . has Question Mark Ġ!= Ġhas Question Mark ) Ġreturn Ġfalse ĊĠĠĠ Ġval Ġclass Symbol Ġ= Ġthis . classifier Ġas ? ĠIr Class Symbol Ġ?: Ġreturn Ġfalse ĊĠĠĠ Ġreturn Ġclass Fq Name Equals ( class Symbol . descriptor , Ġfq Name ) Ċ } Ċ Ċ private Ġfun Ġclass Fq Name Equals ( descriptor : ĠClass Descriptor , Ġfq Name : ĠF q Name Unsafe ): ĠBoolean Ġ= ĊĠĠĠ Ġdescriptor . name Ġ== Ġfq Name . short Name () Ġ&& Ġfq Name Ġ== Ġget Fq Name ( descriptor ) Ċ Ċ fun ĠIr Type . is Any (): ĠBoolean Ġ= Ġis BuiltIn ClassType ( Kotlin Built Ins :: is Any , Ġhas Question Mark Ġ= Ġfalse ) Ċ fun ĠIr Type . is Nullable Any (): ĠBoolean Ġ= Ġis BuiltIn ClassType ( Kotlin Built Ins :: is Any , Ġhas Question Mark Ġ= Ġtrue ) Ċ Ċ fun ĠIr Type . isString (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES . string ) Ċ fun ĠIr Type . is Nullable String (): ĠBoolean Ġ= Ġis Nullable ClassType ( Kotlin Built Ins . FQ _ NAMES . string ) Ċ fun ĠIr Type . isArray (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES . array ) Ċ fun ĠIr Type . is Nothing (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES . nothing ) Ċ fun ĠIr Type . is Primitive Type (): ĠBoolean Ġ= ĊĠĠĠ Ġis BuiltIn ClassType ( Kotlin Built Ins :: is Primitive Class , Ġhas Question Mark Ġ= Ġfalse ) Ċ Ċ fun ĠIr Type . is Nullable Primitive Type (): ĠBoolean Ġ= ĊĠĠĠ Ġis BuiltIn ClassType ( Kotlin Built Ins :: is Primitive Class , Ġhas Question Mark Ġ= Ġtrue ) Ċ Ċ fun ĠIr Type . is Marked Nullable () Ġ= Ġ( this Ġas ? ĠIr Simple Type )?. has Question Mark Ġ?: Ġfalse Ċ Ċ fun ĠIr Type . is Unit () Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES . unit ) Ċ fun ĠIr Type . is Nullable Unit () Ġ= Ġis Nullable ClassType ( Kotlin Built Ins . FQ _ NAMES . unit ) Ċ fun ĠIr Type . is Unit Or Nullable Unit () Ġ= Ġthis . is Unit () Ġ|| Ġthis . is Nullable Unit () Ċ Ċ fun ĠIr Type . is Boolean (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ boolean ) Ċ fun ĠIr Type . is Char (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ char ) Ċ fun ĠIr Type . is Byte (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ byte ) Ċ fun ĠIr Type . is Short (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ short ) Ċ fun ĠIr Type . is Int (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ int ) Ċ fun ĠIr Type . is Long (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ long ) Ċ fun ĠIr Type . is Float (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ float ) Ċ fun ĠIr Type . is Double (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES ._ double ) Ċ fun ĠIr Type . isNumber (): ĠBoolean Ġ= Ġis NotNull ClassType ( Kotlin Built Ins . FQ _ NAMES . number ) Ċ Ċ fun ĠIr Type . is Nullable Boolean (): ĠBoolean Ġ= Ġis Nullable ClassType ( Kotlin Built Ins . FQ _ NAMES ._ boolean ) Ċ fun ĠIr Type . is Nullable Long (): ĠBoolean Ġ= Ġis Nullable ClassType ( Kotlin Built Ins . FQ _ NAMES ._ long ) Ċ fun ĠIr Type . is Nullable Char (): ĠBoolean Ġ= Ġis Nullable ClassType ( Kotlin Built Ins . FQ _ NAMES ._ char ) Ċ