title: IntelliJ Kotlin build does nothing
body: <p>I have seen the following issue repeatedly while building multiple Kotlin projects using IntelliJ IDEA Ultimate <code>Build #IU-222.3739.54</code> (August 2022) and Kotlin plugin <code>222-1.7.10-release-334-IJ3739.54</code>:</p>
  <p>After making a change to existing sources and attempting to run a functional test I get an error such as:</p>
  <pre><code>Kotlin: Cannot find a parameter with this name: plan_type
  </code></pre>
  <p>The change I just made was adding the said enumeration to an existing enum class. Checking the logs I see mention of the alleged compilation error that gets displayed in the IDE:</p>
  <pre><code>2022-09-06 18:03:51,521 [1573161]   INFO - #c.i.c.ComponentStoreImpl - Saving appEditorSettings took 15 ms, FileTypeManager took 14 ms
  2022-09-06 18:04:14,831 [1596471]   INFO - #c.i.c.i.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
  2022-09-06 18:04:15,975 [1597615]   INFO - #c.i.c.s.BuildManager - Using preloaded build process to compile /Users/lexluthor/Workspaces/billing-service
  2022-09-06 18:04:15,994 [1597634]   INFO - #o.j.k.i.s.r.KotlinCompilerReferenceIndexStorage - KCRI storage is closed
  2022-09-06 18:04:16,013 [1597653]   INFO - #c.i.c.b.CompilerReferenceServiceBase - backward reference index reader is closed
  2022-09-06 18:05:33,532 [1675172]   INFO - #o.j.k.i.s.r.KotlinCompilerReferenceIndexStorage - KCRI storage is opened: took 50 ms for 1 storages (filling map: 47 ms, flush to storage: 3 ms)
  2022-09-06 18:05:33,551 [1675191]   INFO - #c.i.c.b.CompilerReferenceServiceBase - backward reference index reader is opened
  2022-09-06 18:05:33,886 [1675526]   INFO - #c.i.c.i.CompilerUtil -      COMPILATION FINISHED (BUILD PROCESS); Errors: 1; warnings: 0 took 79046 ms: 1 min 19sec
  2022-09-06 18:05:34,264 [1675904]   INFO - #c.i.c.s.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /Users/lexluthor/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.3739.54/IntelliJ IDEA.app/Contents/plugins/java/lib/jps-launcher.jar
  2022-09-06 18:05:46,991 [1688631]   INFO - #c.i.c.ComponentStoreImpl - Saving Project(name=billing-service, containerState=COMPONENT_CREATED, componentStore=/Users/lexluthor/Workspaces/billing-service)RunManager took 18 ms
  </code></pre>
  <blockquote>
  <p>COMPILATION FINISHED (BUILD PROCESS); Errors: 1</p>
  </blockquote>
  <p>There doesn't appear to be any mention of the said error anywhere else in the log output. Here's some additional observations I have made:</p>
  <ul>
  <li>The issue only occurs when building a Kotlin project using Gradle and the language version is <code>1.7.0</code> or <code>1.7.10</code>. The issue does not occur if I set the language version to either <code>1.6.21</code> or <code>1.7.20-Beta</code>.</li>
  <li>The issue only occurs when using the <em>IntelliJ IDEA</em> builder under <em>Gradle Settings</em>: <code>Preferences | Build, Execution, Deployment | Build Tools | Gradle | Gradle Projects | Build and run | Build and run using</code>. Switching to the <em>Gradle</em> builder in the aforementioned settings allows me to build the project <em>without any errors</em>. Subsequently switching back to the <em>IntelliJ IDEA</em> builder after a successful <em>Gradle</em> build appears to fix the issue in the IDE.</li>
  <li>The issue cannot be easily reproduced on a trivial project. I have not been able to reproduce the issue using a demo project generated using <a href="https://start.spring.io/" rel="nofollow noreferrer">Spring Initilzr</a> but I experience this issue frequently while making trivial changes to existing, medium-size, Kotlin projects <em>and</em> the previous two conditions are met.</li>
  </ul>
  <p>I have searched the issue in <a href="https://youtrack.jetbrains.com/issues/KTIJ" rel="nofollow noreferrer">JetBrains YouTrack</a> without success..</p>