Conversation
privat
left a comment
There was a problem hiding this comment.
First batch of comments, I will finish latter
src/compiler/abstract_compiler.nit
Outdated
| # Otherwise, we get a compile error exactly here. This weird behavior doesn't affect | ||
| # the inner mecanics of callref since the return type is already solved by | ||
| # `routine_ref_call` | ||
| if ret != null and not compiler.all_routine_types_name.has(cname) then |
There was a problem hiding this comment.
I couldn't reproduce the weird behavior. Do you have a minimal example? (also put it in the /tests directory)
There was a problem hiding this comment.
I added tests/test_callref.nit, this behavior only occured if you compile in semi-global.
Here the assertion result :
Runtime assert: RESULT.can_resolve_for(Fun0[Object], FunRef0[nullable Object], test_callref)
| # -- and covariance. Thus, creating warnings when | ||
| # -- compiling in global. However, if you ignore | ||
| # -- those warnings, the binary works perfectly fine. | ||
| # ~~~~ |
There was a problem hiding this comment.
I think we can live with the warning for now, --global it not a popular option. #2781 is problematic because its a new warning and cannot be disabled without breaking previous version of gcc. Maybe we will just disable all C warnings.
privat
left a comment
There was a problem hiding this comment.
do not commit binary files: tests/syntax_callref
af8eb24 to
556a50d
Compare
privat
left a comment
There was a problem hiding this comment.
Space are both important and not important.
- Use correct indentation on every piece of code you add or change: this improves the overall quality of the code
- Do not change space or anything in pieces of code unrelated to the commit: otherwise, this make code review and blaming more complex
As a rule of thumb:
- Beware of global code change (sed or text editor search&replace)
- Check your commits do avoid unrelated change. Either interactively when doing them (
git guiwith "stage hunk/line" orgit add -i) or before pushing (gitkorgit log -p)
| # WARNING: we must not resolve the return type when it's a functional type. | ||
| # Otherwise, we get a compile error exactly here. This weird behavior doesn't affect | ||
| # the inner mecanics of callref since the return type is already solved by | ||
| # `routine_ref_call` | ||
| if ret != null and not compiler.all_routine_types_name.has(cname) then |
There was a problem hiding this comment.
This is really weird. Do you have a test-case? I cannot reproduce a case where the additional condition is needed.
7f42b83 to
53ff63f
Compare
53ff63f to
bc805e1
Compare
Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
- Added test case in `src/compiler/test_callref.nit` - Updated the API of `AbstractCompiler` to support routine reference call and instantiation services. - Implemented routine reference (callrefs) handling for separate compiler Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
d06716a to
21a2325
Compare
Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
21a2325 to
0709376
Compare
~~~~nitish class A[E] fun foo: A[E] do return self fun bar: Fun0[A[E]] do return &foo # it didn't work before end ~~~~ - Fixed a bug when `self` was a generic class with unsolved type. It was impossible to return a callref, since the typing rule were not properly executed. - Added a test case in `test_callref.res` Signed-off-by: Louis-Vincent Boudreault <lv.boudreault95@gmail.com>
67d4e94 to
31110c7
Compare
Pull-Request: #2793 Reviewed-by: Jean Privat <jean@pryen.org>
No description provided.