Skip to content

Commit

Permalink
Fix grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacl committed Oct 14, 2024
1 parent 9dfd092 commit 92689a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/scala/newtypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import alleycats.Zero
//
// Details: The classes use witnesses to ensure type compatibility. However, in order to completely inline
// simple methods like `<` (OpaqueInt), we cannot use the witness, and instead "cast" using asInstanceOf.
// during compile scala3 (as of now) detects and redundant casts when using asInstanceOf, but it does *not*
// detect or remove witness casts. So, when using asInstanceOf, types are completely elided, but not so with
// witnesses. This is especially problematic for methods marked with `inline` which are expected to be small.
// During compilation, scala3 detects and removes redundant casts when using asInstanceOf, but it does *not*
// detect or remove redudant witness casts. So, when using asInstanceOf, types are completely elided, but not
// so with witnesses. This is especially problematic for methods marked `inline` which should be small.
//
// The challenge for you, dear coder, when writing new code, either in this file or in a subclass, is that
// you can accidentally rely on a witness cast, because scala will happily use a witness implicitly.
Expand Down

0 comments on commit 92689a3

Please sign in to comment.