{"action":"created","issue":{"url":"https://api.github.com/repos/KSP-KOS/KOS/issues/1792","repository_url":"https://api.github.com/repos/KSP-KOS/KOS","labels_url":"https://api.github.com/repos/KSP-KOS/KOS/issues/1792/labels{/name}","comments_url":"https://api.github.com/repos/KSP-KOS/KOS/issues/1792/comments","events_url":"https://api.github.com/repos/KSP-KOS/KOS/issues/1792/events","html_url":"https://github.com/KSP-KOS/KOS/issues/1792","id":173585944,"number":1792,"title":"addition changes type","user":{"login":"Gotbread","id":19180639,"avatar_url":"https://avatars.githubusercontent.com/u/19180639?v=3","gravatar_id":"","url":"https://api.github.com/users/Gotbread","html_url":"https://github.com/Gotbread","followers_url":"https://api.github.com/users/Gotbread/followers","following_url":"https://api.github.com/users/Gotbread/following{/other_user}","gists_url":"https://api.github.com/users/Gotbread/gists{/gist_id}","starred_url":"https://api.github.com/users/Gotbread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gotbread/subscriptions","organizations_url":"https://api.github.com/users/Gotbread/orgs","repos_url":"https://api.github.com/users/Gotbread/repos","events_url":"https://api.github.com/users/Gotbread/events{/privacy}","received_events_url":"https://api.github.com/users/Gotbread/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-27T08:38:38Z","updated_at":"2016-08-27T15:40:22Z","closed_at":null,"body":"![koserr9](https://cloud.githubusercontent.com/assets/19180639/18026289/f33432ec-6c41-11e6-8c76-27c46903da9a.png)\r\n\r\nThis simple program takes a scalar argument and adds it to another scalar from global scope. The screenshots show both are scalar in type. Yet the addition creates a string instead of a scalar.\r\n\r\nanother program which simply \"set ret to 5.\" gives a ret:typename of scalar, as intended.\r\n\r\nEdit:\r\n\r\nThe value \"ret\" converts into string even before the function ends.\r\n\r\n```\r\nset ret to _param + parent_body.radius.\r\nprint _param:typename.\r\nprint parent_body:radius:typename.\r\nprint ret:typename.\r\n```\r\ngives:\r\n```\r\nscalar\r\nscalar\r\nstring\r\n```"},"comment":{"url":"https://api.github.com/repos/KSP-KOS/KOS/issues/comments/242924183","html_url":"https://github.com/KSP-KOS/KOS/issues/1792#issuecomment-242924183","issue_url":"https://api.github.com/repos/KSP-KOS/KOS/issues/1792","id":242924183,"user":{"login":"Efratror","id":19653269,"avatar_url":"https://avatars.githubusercontent.com/u/19653269?v=3","gravatar_id":"","url":"https://api.github.com/users/Efratror","html_url":"https://github.com/Efratror","followers_url":"https://api.github.com/users/Efratror/followers","following_url":"https://api.github.com/users/Efratror/following{/other_user}","gists_url":"https://api.github.com/users/Efratror/gists{/gist_id}","starred_url":"https://api.github.com/users/Efratror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Efratror/subscriptions","organizations_url":"https://api.github.com/users/Efratror/orgs","repos_url":"https://api.github.com/users/Efratror/repos","events_url":"https://api.github.com/users/Efratror/events{/privacy}","received_events_url":"https://api.github.com/users/Efratror/received_events","type":"User","site_admin":false},"created_at":"2016-08-27T15:40:22Z","updated_at":"2016-08-27T15:40:22Z","body":"I've tried to replicate your bug with the following code:\r\n\r\n```\r\nset _param to 10.\r\nset parent_body to kerbin.\r\nset ret to _param + parent_body:radius.\r\nprint ret:typename.\r\n```\r\noutput:\r\n\r\n> Scalar\r\n\r\nCorrect me if i'm wrong but i think you made a typo in `set ret to _param + parent_body:radius.` you use parent_body(dot)radius instead of parent_body(colon)radius. When you use an undefined variable kOS assumes its an empty string. So it doesn't change the type of a scalar to a string but it is in fact a string. Take a look at the [lazy global directive](https://ksp-kos.github.io/KOS/language/variables.html#lazyglobal-directive) to make typos a thing of the past.\r\n"}}
{"actor":{"display_login":"Efratror"}}