diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-12 16:39:07 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-12 16:39:07 -0700 |
commit | 4615ec5446643ad8dc3549c1e9c6deb102d2ff7a (patch) | |
tree | 085fcc1197de9d5c709976f9ce9f85033450731c | |
parent | f0b37c2f8f7ba865c8fedda4bf6b47192d9e2ebf (diff) | |
download | scala-4615ec5446643ad8dc3549c1e9c6deb102d2ff7a.tar.gz scala-4615ec5446643ad8dc3549c1e9c6deb102d2ff7a.tar.bz2 scala-4615ec5446643ad8dc3549c1e9c6deb102d2ff7a.zip |
SI-4980 isInstanceOf does not do outer checks
-rw-r--r-- | 14-the-scala-standard-library.md | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/14-the-scala-standard-library.md b/14-the-scala-standard-library.md index 068f886e19..5b408cff61 100644 --- a/14-the-scala-standard-library.md +++ b/14-the-scala-standard-library.md @@ -94,11 +94,9 @@ $x$ match { ``` where the type $T'$ is the same as $T$ except if $T$ is -of the form $D$ or $D[\mathit{tps}]$ where $D$ is a type member of some outer -class $C$. In this case $T'$ is `$C$#$D$` (or -`$C$#$D[tps]$`, respectively), whereas $T$ itself would -expand to `$C$.this.$D[tps]$`. In other words, an -`isInstanceOf` test does not check for the +of the form $D$ or $D[\mathit{tps}]$ where $D$ is a type member of some outer class $C$. +In this case $T'$ is `$C$#$D$` (or `$C$#$D[tps]$`, respectively), whereas $T$ itself would expand to `$C$.this.$D[tps]$`. +In other words, an `isInstanceOf` test does not check that types have the same enclosing instance. The test `$x$.asInstanceOf[$T$]` is treated specially if $T$ is a |