# Type Mismatch trying to make a session modification function reusable

**URL:** <https://community.gatling.io/t/type-mismatch-trying-to-make-a-session-modification-function-reusable/5245>\
**Category:** Gatling (Open-Source)\
**Created:** [September 18, 2019, 9:16pm UTC](https://community.gatling.io/t/type-mismatch-trying-to-make-a-session-modification-function-reusable/5245 "2019-09-18T21:16:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarrowwx](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jarrowwx](https://community.gatling.io/u/jarrowwx)\
**Post date:** [September 18, 2019, 9:16pm UTC](https://community.gatling.io/t/type-mismatch-trying-to-make-a-session-modification-function-reusable/5245/1 "2019-09-18T21:16:07Z")

</div>

This compiles:

.exec( \_.set( “foo”, “bar” ) )

This does not:

def foobar = ( Session : Session ) = \_.set( “foo”, “bar” )  
…  
.exec( foobar )

It is telling me that foobar is of the wrong type. It says it expects one of ActionBuilder, Execs[_], Iterable[Execs[_]], or session.Expression[Session].

Exactly what am I doing wrong? Am I missing an import, maybe?

This is 3.2.1
