-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
554 var in out strings returned from functions are truncated to length 81 #568
554 var in out strings returned from functions are truncated to length 81 #568
Conversation
…ing generic type resolution and buils
…ions-are-truncated-to-length-81
Codecov ReportBase: 93.76% // Head: 93.81% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #568 +/- ##
==========================================
+ Coverage 93.76% 93.81% +0.05%
==========================================
Files 46 46
Lines 17604 17661 +57
==========================================
+ Hits 16506 16569 +63
+ Misses 1098 1092 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…r string parameters that are shorter than they were declared as
…54-var_in_out-strings-returned-from-functions-are-truncated-to-length-81
… had the name 'placeholder'.
… had the name 'placeholder'. Removes overly convoluted test.
updates generic resolver tests. changes string type annotation for literals. adds requested comments to previous changes.
…ngs-returned-from-functions-are-truncated-to-length-81
…from-functions-are-truncated-to-length-81' into 554-var_in_out-strings-returned-from-functions-are-truncated-to-length-81
…ions-are-truncated-to-length-81
…ions-are-truncated-to-length-81
…ions-are-truncated-to-length-81
src/index.rs
Outdated
@@ -1395,6 +1395,18 @@ impl Index { | |||
} => self | |||
.find_effective_type_info(referenced_type) | |||
.unwrap_or(initial_type), | |||
DataTypeInformation::String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit surprising for me.
is this always right? - also if you think about the contract of the method?
why is the intrinsic of STRING[10] == STRING[80]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would feel better if this special case
gets handled somewhere in the generics.rs
call_name: Some(call_name), | ||
}, | ||
) | ||
let annotation = self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets rename and document this function
better name: get_specific_function_annotation and in the parameters ask for: generic_qualified_name &generic_return_type
takes the generic signature of a function generic function and resolves it to its specific types according to the generic_map and the generic_name_resolver.
@@ -73,8 +73,6 @@ impl<'i> TypeAnnotator<'i> { | |||
.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: make clear that this information describes the generic function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good, I added 2 or 3 small remarks
…ions-are-truncated-to-length-81
…osure for is_call. regression from #604. added test to show correct behaviour
due to the changes from #605, string varargs are now passed as double pointers. this will be fixed in a separate issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets undo the set_is_call lambda thing
resolver.rs:1295 self.visit_statement(&ctx.set_is_call(), operator);
the changes from 554 also fix the issue from 635
Added the failing test from #635. The generated snap looks good to me and I think the issue can be closed as soon as this PR is approved and merged. |
…ions-are-truncated-to-length-81 fixes merge conflicts. adds allow dead code pragma to unused function in tests.rs - maybe it should be removed instead.
…ions-are-truncated-to-length-81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good work
Fixes generic function annotation for string generics to allow for string lengths > 80. It is now also possible to pass long string literals as function parameters without saving them into a variable first.
Fixes Issue #554