ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

Partial call allowed without a `?`

Open dipinhora opened this issue 8 years ago • 1 comments

The following code:

trait T
  fun f1() ? => error
  fun f2() ? => f1()

actor Main is T
  new create(env: Env) =>
    None

Results in the following errors in 0.19.2 (see playground: http://playground.ponylang.org/?gist=19514f10bd5c0e1146a610bdb896f174):

0.19.2 [release]
compiled with: llvm 3.9.1 -- cc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Error:
main.pony:3:20: call is not partial but the method is - a question mark is required after this call
  fun f2() ? => f1()
                   ^
    Info:
    main.pony:2:12: method is here
      fun f1() ? => error
               ^
Error:
main.pony:3:20: call is not partial but the method is - a question mark is required after this call
  fun f2() ? => f1()
                   ^
    Info:
    main.pony:2:12: method is here
      fun f1() ? => error
               ^

However, the same code compiles without error on current master.

dipinhora avatar Oct 09 '17 15:10 dipinhora

This was probably an unintended consequence of #2261.

jemc avatar Oct 09 '17 15:10 jemc