You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/JavaScriptKit/Documentation.docc/Articles/BridgeJS/Unsupported-Features.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,9 @@ Generic functions are supported in both directions, through a type parameter con
42
42
-`async` generic functions.
43
43
- Generic methods inside `@JSClass` types or static members (generics are top-level only).
44
44
-`where` clauses on a generic declaration.
45
-
- A declared generic parameter that is not used in any parameter.
46
-
- An exported generic function that returns a concrete, non-`Void` type. The result of an exported generic function must be one of the declared generic parameters or `Void`.
45
+
- An exported `@JS` generic function that is `throws`. (Imported `@JSFunction` generics may still use `throws(JSException)`.)
46
+
- A declared generic parameter on an exported `@JS` function that is not used in any parameter. A return-only generic (such as `make<T>() -> T`) is supported for imported `@JSFunction`s, where the JavaScript implementation produces the value.
47
+
- An exported generic function that returns a concrete, non-`Void` type. The result of an exported generic function must be one of the declared generic parameters (optionally wrapped in `[T]`, `T?`, or `[String: T]`) or `Void`.
47
48
48
49
The generic parameter may be used bare (`T`) or wrapped in `[T]`, `T?`, or `[String: T]`. Nested or other wrappings, such as `[T?]`, `[[T]]`, `T??`, or `[Int: T]`, are not supported and produce build-time diagnostics. `JSObject` cannot be used as the generic argument (it is a non-final class); use `JSValue` instead.
0 commit comments