type_resolver: fix comptimecall resolving aliased method#25254
Merged
Conversation
Contributor
|
Hm, interesting ... the compilation error for the issue is gone, but it still does not behave as it should, perhaps due to an unrelated bug: import veb
pub struct Context {
veb.Context
}
pub struct App {
veb.Middleware[Context]
veb.Controller
veb.StaticHandler
}
pub fn (mut app AliasApp) index(mut ctx Context) veb.Result {
return ctx.text('Hello V!')
}
type AliasApp = App
type AliasContext = Context
mut app := &AliasApp{}
veb.run_at[AliasApp, AliasContext](mut app,
port: 12343
family: .ip
)!This produces: VV_LOC _result_Map_string_veb__Route veb__generate_routes_T_main__AliasApp_main__AliasContext(main__AliasApp* app) {
Map_string_veb__Route routes = new_map(sizeof(string), sizeof(veb__Route), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_str$
;
_v_dump_expr_string(_S("/home/delian/v/vlib/veb/veb.v"), 41, _S("typeof[A]()"), _S("AliasApp"));
/* $for method in main.App.methods */ {
}// $for
_result_Map_string_veb__Route _t1 = {0};
_result_ok(&(Map_string_veb__Route[]) { routes }, (_result*)(&_t1), sizeof(Map_string_veb__Route));
return _t1;
}(after a small modification to It appears that |
Contributor
|
The compiler did know the full aliased type (it resolved properly the It seems that only the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #25253