E4008

E4008#

FFI function cannot have type parameters.

Erroneous Example#

pub extern "js" fn id[T](x : T) -> T = "(x) => x"

The example declares an FFI function (marked extern) with a type parameter, which is not allowed.

Suggestion#

Consider using a concrete type that suits your needs:

///|
extern "js" fn int_id(x : ) ->  = "(x) => x"

///|
pub fn ( : ) ->  {
  int_id()
}

For more complicated scenarios, consider adding an extra trait:

///|
pub(open) trait  {
  () -> 
}

///|
impl  for  with () {
  ()
}

///|
pub fn ( : ) ->  {
  ::()
}