Skip to content
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

Assign error code when concatenation fails #113

Open
wants to merge 2 commits into
base: master
from

Conversation

@pawelduda
Copy link

commented Aug 2, 2019

Issue #27, if available:

Description of changes:
Solves issue #27

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@pawelduda

This comment has been minimized.

Copy link
Author

commented Aug 2, 2019

Feel free to give me some feedback, I am not a Kotlin person at all

@pawelduda pawelduda marked this pull request as ready for review Aug 2, 2019

@pawelduda pawelduda force-pushed the pawelduda:assign-error-code-when-concat-fails branch from 1170a1a to c07acdc Aug 2, 2019

@@ -77,8 +77,11 @@ fun ExprValue.numberValue(): Number =
fun ExprValue.timestampValue(): Timestamp =
scalar.timestampValue() ?: errNoContext("Expected timestamp: $ionValue", internal = false)

fun ExprValue.stringValue(): String =
scalar.stringValue() ?: errNoContext("Expected text: $ionValue", internal = false)
fun ExprValue.stringValue(): String = scalar.stringValue() ?:

This comment has been minimized.

Copy link
@therapon

therapon Aug 2, 2019

Contributor

This is a general extension function that is called in multiple use cases that require to obtain a String from an ExprValue, one such case is when we need to evaluate a string append || operator.

Making this extension function report an error that always states it is due to a string append operation might lead to miscommunication.

I think the logic needs to go here where the code deals with string append. Each argument to || needs to be checked and if it is not a String value then report the more specific error message that || did not receive a value of the appropriate type (String)

This comment has been minimized.

Copy link
@pawelduda

pawelduda Aug 2, 2019

Author

Makes sense - I'll attempt to fix it before next week.

This comment has been minimized.

Copy link
@pawelduda

pawelduda Aug 18, 2019

Author

@therapon Can anyone take this over? A lot going on in my life, I would love to help you out but I cannot do that. Should I just trash this PR?

This comment has been minimized.

Copy link
@dlurton

dlurton Aug 26, 2019

Member

Definitely don't delete it. One of us will take it over when there's time. Thanks.

This comment has been minimized.

Copy link
@pawelduda

pawelduda Aug 27, 2019

Author

No problem, I'm glad I could contribute something meaningful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.