mojo icon indicating copy to clipboard operation
mojo copied to clipboard

add note that custom decorators are not supported yet

Open KarateCowboy opened this issue 9 months ago • 1 comments

KarateCowboy avatar May 05 '24 23:05 KarateCowboy

Hi. It's a miniscule change, but would have saved me a good hour, had it been there. Had to query in the Discord about why this code was compiling and running, but all that printed was 'Hallo'

 fn logger_thing[func: fn () -> None]() -> fn () -> None:
  fn inner():
    print("you are decorative")
    func()
  return inner 

@logger_thing
fn say_hallo():
  print("Hallo")


fn main():
  say_hallo()

Oh, and, I'm new to this DCO and 'signed-off' stuff.

KarateCowboy avatar May 05 '24 23:05 KarateCowboy

Thanks for the pull request, indeed, that will help other users. If you want I can help you out.

  • Concerning the DCO, the instructions are here to fix an existing PR: https://github.com/modularml/mojo/pull/2539/checks?check_run_id=24614427145 . I don't recommend doing this now since you'll need to open another PR. See below:
  • Another thing that needs to be fixed: the target branch should be nightly, no main. Here you target main. Feel free to close this PR and open a new PR targeting the nightly branch. When you commit on this new branch, use git commit -s and that will ensure that you're not bothered by the DCO.

gabrieldemarmiesse avatar May 06 '24 12:05 gabrieldemarmiesse

Thanks for the PR! Seconding what @gabrieldemarmiesse said, if you can sign the commits and create a new PR against main, we can help you get this landed.

arthurevans avatar May 06 '24 17:05 arthurevans

Great great. You guys are fast. i'll put together a new PR this evening after work

KarateCowboy avatar May 06 '24 21:05 KarateCowboy