E4000

E4000#

Generic type variable name is already used.

Erroneous example#

///|
struct Container[T, T] {
  value : T
}

///|
fn[A, A] transform(x : A) -> A {
  x
}

Suggestion#

Use different names for type variables:

///|
priv struct [T1, T2] {
   : T1
   : T2
}

///|
fn[A, B] ( : A,  : (A) -> B) -> B {
  ()
}

///|
test {
  let  : [, ] = { : 1, : "one" }
  (., ="1")
  (., ="one")
  ((1, fn() { .() }), ="1")
}

Or remove the duplicate type parameter if you meant to use the same type:

///|
priv struct [T] {
   : T
}

///|
fn[A] ( : A) -> A {
  
}

///|
test {
  let  : [] = { : 1 }
  (., ="1")
  (("value"), ="value")
}