tokiwa-software / fuzion

The Fuzion Language Implementation
https://fuzion-lang.dev
GNU General Public License v3.0
45 stars 9 forks source link

redefining feature x.q whose type parameter has a constraint depending on outer feature's type parameter. #3243

Open michaellilltokiwa opened 2 weeks ago

michaellilltokiwa commented 2 weeks ago
  # second case, redefining feature x.q whose type parameter has a
  # constraint depending on outer feature's type parameter.
  #
  case2(C type, v C) =>
    x is
      q(U type: Sequence C) => say "x: $U $C"

    y : x is
      redef q(U type: Sequence C) => say "y: $U $C"

    x.q (array C)
    x.q (list C)
    y.q (list C)

  case2 String "str"
  case2 f32 3.14