Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using blacklists in Recorder leads to 'ambiguous reference' in the generated script #2067

Closed
nremond opened this issue Aug 6, 2014 · 1 comment

Comments

@nremond
Copy link
Contributor

nremond commented Aug 6, 2014

When I use the blacklist in the recorder, the script wil contain the line:

.inferHtmlResources(black = BlackList(""".*\.css.*"""), white = WhiteList())

But the compiler in Eclipse (+ Scala IDE for Eclipse) complains:

ambiguous reference to overloaded definition, both method inferHtmlResources in class HttpProtocolBuilder of type (black: io.gatling.core.filter.BlackList, white: io.gatling.core.filter.WhiteList)io.gatling.http.config.HttpProtocolBuilder and method inferHtmlResources in class HttpProtocolBuilder of type (white: io.gatling.core.filter.WhiteList, black: io.gatling.core.filter.BlackList)io.gatling.http.config.HttpProtocolBuilder match argument types (black: io.gatling.core.filter.BlackList,white: io.gatling.core.filter.WhiteList)

When I leave the parameter names out of the method call, the compiler can resolve the correct overload by type:

.inferHtmlResources(BlackList(""".*\.css.*"""), WhiteList())

See https://groups.google.com/forum/#!topic/gatling/c087ltWzdAM

@pdalpra pdalpra added this to the 2.0.0-RC2 milestone Aug 6, 2014
@pdalpra pdalpra self-assigned this Aug 6, 2014
@pdalpra
Copy link
Contributor

pdalpra commented Aug 6, 2014

Ah, a nice example where overloading and named parameters conflict with each other.
When parameters are "unnamed", it resolves to a call to either one of those overloaded versions of inferHtmlResources :

  • inferHtmlResources(BlackList, WhiteList)
  • inferHtmlResources(WhiteList, BlackList)

But here, since parameters are named, both overloaded versions are applicable, and the compiler can't decide which one to pick.
We'll drop the named parameters in the generated simulation.

@pdalpra pdalpra closed this as completed in 26a5e37 Aug 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants