Skip to content

Commit 56938cf

Browse files
committed
update IsConst documentation
1 parent e675e77 commit 56938cf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

library/src/scala/compiletime/ops/any.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ object any:
2929
* val c1: IsConst[1] = true
3030
* val c2: IsConst["hi"] = true
3131
* val c3: IsConst[false] = true
32+
* val c4: IsConst[Any] = false
33+
* ```
34+
* If the type is not yet known, then `IsConst` remains unevaluated, and
35+
* will be evaluated only at its concrete type application. E.g.:
36+
* ```scala
37+
* //def `isConst`` returns the type `IsConst[X]`, since `X` is not yet known.
38+
* def isConst[X] : IsConst[X] = ???
39+
* val c5 : true = isConst[1] //now the type is known to be a constant
40+
* val c6 : false = isConst[Any] //now the type is known to be not a constant
3241
* ```
3342
* @syntax markdown
3443
*/

0 commit comments

Comments
 (0)