--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/989df5c5-5593-49a3-aaa5-381d4d5d7dd4n%40googlegroups.com.
Hello,
Being new to Scala I thought I could ask about the observed “magic” out of personal interest.
This “magic” comes basically from implicit conversion.
When the compiler does not find direct implementation (either an attribute or a method) in the type of the variable, it checks if there are implicit conversions in the scope that can be applied to the current variable that satisfies the requested name (attribute or method).
Terminology:
Integer.parseInt(str: String): Int (conversion from String to Int)To put such implicit conversions in scope, we required you to import io.gatling.core.Predef._, so, everything in Predef (and its ancestor) is imported in scope.
For the specific case you mention:
ValidatorCheckBuilder implements CheckBuilder.Validate (a Validate trait declared in CheckBuilder object)saveAs methodio.gatling.core.Predef extends CoreDsl that itself extends CheckSupportPredefvalidate2Final implicit conversion to obtain a CheckBuilder.Final that implements the saveAs methodFor more about implicit conversions:
But all of these explanations are way beyond the purpose of this mailing list.
Hope that helps to understand,
Cheers!
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/8ad6cf0d-ffcf-4e17-ae9a-61110c7a851fn%40googlegroups.com.
Sébastien BREVETBackend engineer |
|