Documentation bug for sourceSet srcDir

Both 1.12 and 2.0 show this example for

23.4.1. Changing the project layout

sourceSets {
    main {
        java {
            srcDir 'src/java'
        resources {
            srcDir 'src/resources'

But when executing that I get:

> No such property: srcDir for class: org.gradle.api.internal.file.DefaultSourceDirectorySet
  Possible solutions: srcDirs

I thought all the documented examples are part of the build/CI process so should be valid working examples?

When changing to srcDirs it indeed works