You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2018/08/07 03:12:11 UTC
groovy git commit: improve wording
Repository: groovy
Updated Branches:
refs/heads/master 3b82478e0 -> 9f7789ca8
improve wording
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/9f7789ca
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/9f7789ca
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/9f7789ca
Branch: refs/heads/master
Commit: 9f7789ca8537e1a34428059fcbf2d4f440291edc
Parents: 3b82478
Author: Paul King <pa...@asert.com.au>
Authored: Tue Aug 7 13:12:01 2018 +1000
Committer: Paul King <pa...@asert.com.au>
Committed: Tue Aug 7 13:12:01 2018 +1000
----------------------------------------------------------------------
src/spec/doc/core-traits.adoc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/9f7789ca/src/spec/doc/core-traits.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-traits.adoc b/src/spec/doc/core-traits.adoc
index e74ad98..624bd9e 100644
--- a/src/spec/doc/core-traits.adoc
+++ b/src/spec/doc/core-traits.adoc
@@ -786,7 +786,7 @@ include::{projectdir}/src/spec/test/TraitsSpecificationTest.groovy[tags=selftype
<5> The method from the trait is called, and `id` is resolved
It is clear, here, that the `Communicating` trait can only apply to `Device`. However, there's no explicit
-contract to tell that, because traits cannot extend classes. However, the code compiles and runs perfectly
+contract to indicate that, because traits cannot extend classes. However, the code compiles and runs perfectly
fine, because `id` in the trait method will be resolved dynamically. The problem is that there is nothing that
prevents the trait from being applied to any class which is *not* a `Device`. Any class which has an `id` would
work, while any class that does not have an `id` property would cause a runtime error.
@@ -803,8 +803,8 @@ requires `this` as a parameter, and actually requires it to be a `Device`?
include::{projectdir}/src/spec/test/TraitsSpecificationTest.groovy[tags=selftype_securityservice,indent=0]
----
-If you want to be able to call this in the trait, then you will explicitly need to cast `this` into a `Device`. This can
-quickly become unreadable with explicit casts to this everywhere.
+If you want to be able to call `this` in the trait, then you will explicitly need to cast `this` into a `Device`. This can
+quickly become unreadable with explicit casts to `this` everywhere.
[[traits-selftype]]
=== The @SelfType annotation