gavr123456789 / Niva

Smalltalk like programming language
https://gavr123456789.github.io/niva-site
41 stars 2 forks source link

If return type of constuructor is not defined, it doesnt mean its the Receiver type #273

Closed gavr123456789 closed 7 hours ago

gavr123456789 commented 3 months ago
constructor FileFromDialog fromWindow: window::org.gnome.adw.ApplicationWindow doWithContent::[String -> ] = [
  fileDialog = FileDialog new
  fileDialog 
    openInside: window 
    ifCancelled: null 
    whenReadyDo: [ x, asyncResult, z -> 
      filePath = fileDialog openFinish: asyncResult |> getPath
      x = FileSystem read: filePath toPath
      x echo
      doWithContent String: x
    ]
]

// generates fun FileFromDialog.Companion.fromWindowDoWithContent(window: org.gnome.adw.ApplicationWindow, doWithContent: (String,) -> Unit): reader.FileFromDialog