@@ -50,7 +50,9 @@ package object compiletime {
50
50
* @note only `inline` arguments will be displayed as "code".
51
51
* Other values may display unintutively.
52
52
*/
53
- transparent inline def code (inline args : Any * ): String = ???
53
+ transparent inline def code (inline args : Any * ): String =
54
+ // implemented in dotty.tools.dotc.typer.Inliner.Intrinsics
55
+ error(" `code` was not evaluated by the compiler" )
54
56
55
57
end extension
56
58
@@ -68,18 +70,24 @@ package object compiletime {
68
70
* twice(m) // error: expected a constant value but found: m
69
71
* ```
70
72
*/
71
- inline def requireConst (inline x : Boolean | Byte | Short | Int | Long | Float | Double | Char | String ): Unit = ()
73
+ inline def requireConst (inline x : Boolean | Byte | Short | Int | Long | Float | Double | Char | String ): Unit =
74
+ // implemented in dotty.tools.dotc.typer.Inliner
75
+ error(" `requireConst` was not evaluated by the compiler" )
72
76
73
77
/** Same as `constValue` but returns a `None` if a constant value
74
78
* cannot be constructed from the provided type. Otherwise returns
75
79
* that value wrapped in `Some`.
76
80
*/
77
- inline def constValueOpt [T ]: Option [T ] = ???
81
+ inline def constValueOpt [T ]: Option [T ] =
82
+ // implemented in dotty.tools.dotc.typer.Inliner
83
+ error(" `constValueOpt` was not evaluated by the compiler" )
78
84
79
85
/** Given a constant, singleton type `T`, convert it to a value
80
86
* of the same singleton type. For example: `assert(constValue[1] == 1)`.
81
87
*/
82
- inline def constValue [T ]: T = ???
88
+ inline def constValue [T ]: T =
89
+ // implemented in dotty.tools.dotc.typer.Inliner
90
+ error(" `constValue` was not evaluated by the compiler" )
83
91
84
92
/** Given a tuple type `(X1, ..., Xn)`, returns a tuple value
85
93
* `(constValue[X1], ..., constValue[Xn])`.
@@ -106,8 +114,8 @@ package object compiletime {
106
114
*
107
115
* the returned value would be `2`.
108
116
*/
109
- transparent inline def summonFrom [T ](f : Nothing => T ): T = ???
110
-
117
+ transparent inline def summonFrom [T ](f : Nothing => T ): T =
118
+ error( " `summonFrom` was not evaluated by the compiler " )
111
119
112
120
/** Summon a given value of type `T`. Usually, the argument is not passed explicitly.
113
121
* The summoning is delayed until the call has been fully inlined.
0 commit comments