@neocompose/cli 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -83,7 +83,7 @@ wrappers.
|
|
|
83
83
|
The marker near the top of `SKILL.md` must exactly match the package version:
|
|
84
84
|
|
|
85
85
|
```html
|
|
86
|
-
<!-- reviewed-through-cli: 0.
|
|
86
|
+
<!-- reviewed-through-cli: 0.28.0 -->
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
The quoted version above is checked too, so this instruction cannot go stale
|
|
@@ -152,6 +152,41 @@ them from member initializers. Each declared constructor must settle every
|
|
|
152
152
|
required member on its own; a call-site block cannot repair an invalid
|
|
153
153
|
constructor declaration.
|
|
154
154
|
|
|
155
|
+
## Parameter default values
|
|
156
|
+
|
|
157
|
+
Default a parameter with `= <constant>` on class headers, declared
|
|
158
|
+
constructors, native functions, NSFunctions, and interface functions:
|
|
159
|
+
|
|
160
|
+
```neo
|
|
161
|
+
class Foo(string bar = "BAR", int volume = 3) {
|
|
162
|
+
public string Bar = bar;
|
|
163
|
+
|
|
164
|
+
public string Shout(string text = "hey", bool loud = true) {
|
|
165
|
+
return loud ? text.ToUpper() : text;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
Foo a = new(); // fully defaulted header: all defaults apply
|
|
170
|
+
Foo b = new(bar: "bar"); // volume fills from its default
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Use only constants: bool, int, float, and decimal literals (optional leading
|
|
174
|
+
`-`), string literals without interpolation, leading-dot enum options
|
|
175
|
+
(`.North`), and `null` on a nullable parameter. Place every defaulted
|
|
176
|
+
parameter after every non-defaulted one. `Type? name` stays nullable-and-
|
|
177
|
+
mandatory unless it also declares a default — nullability and defaultedness
|
|
178
|
+
are independent.
|
|
179
|
+
|
|
180
|
+
Omit defaulted arguments at call sites: function calls bind positionally and
|
|
181
|
+
drop only a trailing suffix; constructor calls name a subset that covers
|
|
182
|
+
every non-defaulted parameter. When several overloads match, the one filling
|
|
183
|
+
in the fewest defaults wins, and a residual tie is a declaration-time error.
|
|
184
|
+
Implementations of an interface function restate its defaults exactly.
|
|
185
|
+
|
|
186
|
+
Do not default parameters of deferred functions, delegates, actions,
|
|
187
|
+
closures, or overrides. Enum defaults store the option id, so renaming the
|
|
188
|
+
option changes the emitted `.Option` spelling without a record change.
|
|
189
|
+
|
|
155
190
|
## Required constructors and settlement
|
|
156
191
|
|
|
157
192
|
Put one required constructor on the class header when the entire class body
|