Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 27 lines (21 sloc) 0.317 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
# nested_classes.fy
# Example of nested classes in fancy

class Outer {
  class Inner {
    def to_s {
      "Outerr::Inner"
    }
  }

  def to_s {
    "Outer"
  }
}


o = Outer new
o println
i = Outer::Inner new
i println

class Outer InnerTwo {
  def to_s { "Outer InnerTwo" }
}

i = Outer InnerTwo new
i println
Something went wrong with that request. Please try again.