title: Order of evaluation in Spring bean definition dsl for kotlin?
body: <p>I wonder when <code>environment</code> method is being taken into account.</p>
  
  <p>Considering following code:</p>
  
  <pre><code>bean { Bar(ref()) } // requires bean of type Foo
  environment(
      { !activeProfiles.contains("local") },
      { ProdFoo() }))
  environment(
      { activeProfiles.contains("local") },
      { bean&lt;LocalFoo&gt;() })
  </code></pre>
  
  <p>Sometimes I observed errors related with no bean of type <code>Foo</code>. Does it mean that <code>environment</code> is not evaluated as one of the first expressions?</p>