title: Jetpack Compose Modifier with same parameters forces recomposition
body: <p>I have this <code>ScrollableTabRow</code> with list of tabs inside:</p>
  <pre><code>@Immutable
  enum class Tab(val title:Int){
      Some(R.string.some),
      Other(R.string.other);
  }
  
  @Composable
  fun MyTab(modifier: Modifier = Modifier,
            tabs: List&lt;Tab&gt;,
            selectedTab: Tab,
            onTabSelected: (Tab) -&gt; Unit) {
      Log.d(&quot;MyTab&quot;, &quot;Draw&quot;)
  
      if (tabs.isEmpty()) {
          return
      }
  
      ScrollableTabRow(selectedTabIndex = tabs.indexOf(selectedTab),
                       modifier
                           .navigationBarsPadding()
                           .requiredHeight(48.dp),
                       backgroundColor = Color.Transparent,
                       indicator = {},
                       divider = {}) {
  
          tabs.forEach { tab -&gt;
              Log.d(&quot;MyTab&quot;, &quot;${tab.title}-${tab == selectedTab}&quot;)
              val tabModifier = Modifier
                  .clip(RoundedCornerShape(8.dp))
                  .padding(horizontal = 8.dp)
                  .shadow(0.5.dp, RoundedCornerShape(8.dp))
                  .background(MaterialTheme.colors.surface)
                  .border(1.dp,
                      if (tab==selectedTab) MaterialTheme.appColors.bottomTabSelect else Color.Transparent,
                      RoundedCornerShape(8.dp))
                  .clickable {
                      if (tab==selectedTab) {
                          // already selected
                          return@clickable
                      }
                      onTabSelected(tab)
                  }
                  .padding(8.dp)
  
              Test(tab.title, tabModifier, logger)
              
          }
      }
  
  }
  
  
  @Composable
  private fun Test(title: Int,
                   modifier: Modifier) {
      Log.d(&quot;MyTab&quot;, &quot;Test&quot;)
  
      Text(text = stringResource(id = title),
           modifier = modifier,
           color = MaterialTheme.colors.onSurface,
           fontSize = 12.sp,
           textAlign = TextAlign.Center)
  }
  </code></pre>
  <p>Simply, it lays out list of tabs horizontally. Whenever tab is selected, its modifier is updated and border with primary color is drawn. If not selected, then border is transparent.</p>
  <p>My aim is to avoid recomposition of tabs (<em>Test composable in code</em>) if their state is not changed. So if i have 5 tabs, and i select a new tab, only 2 tabs' states are changed and other 3 tabs should not get recomposed.</p>
  <p>Test composable has <code>Int, Modifier</code> as parameters. On recomposition of <code>MyTab</code>, <code>title:Int</code> of <code>Test</code> does not change but <code>tabModifier</code> is created again with same parameters (but new instance). This somehow forces recomposition of all 5 tabs when new tab is selected. But if i move <code>tabModifier</code> inside <code>Test</code> and give <code>tab==selectedTab</code>, <code>tab</code>, <code>selectedTab</code> as parameters, it works as expected.</p>
  <p>Is <code>Modifier</code> created again with same parameters not Stable? Can we avoid recomposition without moving <code>tabModifier</code> into <code>Test</code>? <em>(Modifier interface is marked as @Stable)</em></p>