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

[Bug] Internal Kipper identifiers and target-specific reserved identifiers/keywords can be overwritten by user definitions #153

Closed
3 tasks done
Tracked by #154 ...
Luna-Klatzer opened this issue Jun 4, 2022 · 1 comment · Fixed by #154
Assignees
Labels
bug Bug or issue in the language or API
Milestone

Comments

@Luna-Klatzer
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

I am following the documentation's guide

  • I have read the documentation

This issue exists in the latest version

  • I am using the latest version

Current Behavior

When defining variables in Kipper, there are currently no checks ensuring that their identifiers do not overwrite target-specific identifiers (for example function in TypeScript) or even internal Kipper functions, which provide functionality for Kipper keywords.

This results in undefined behaviour and runtime errors when executing or transpiling such code.

Expected Behavior

When declaring/defining a new variable, the target should run a semantic check asserting the identifier that is used does not overwrite any target-specific keywords or internal Kipper functions (The identifiers of internal Kipper functions are chosen by each target, so the target has to check for both).

Steps To Reproduce

  1. Create a Kipper program with target typescript.
  2. Define a new variable in the program with an identifier that matches a keyword from TypeScript/JavaScript or overwrites an internal function (for example __numToStr() which will be introduced in v0.8.0)

Environment

  • Kipper: 0.8.0-beta.0
  • Environment: Node.js 16.15.0
  • Operating System: Arch Linux 2022.06.01 with Linux 5.15.44-1-lts x86_64
@Luna-Klatzer Luna-Klatzer added bug Bug or issue in the language or API question Further information is requested labels Jun 4, 2022
@Luna-Klatzer Luna-Klatzer self-assigned this Jun 4, 2022
@Luna-Klatzer Luna-Klatzer removed the question Further information is requested label Jun 4, 2022
@Luna-Klatzer Luna-Klatzer added this to the Stable Kipper Release milestone Jun 4, 2022
@Luna-Klatzer Luna-Klatzer changed the title [Bug] Internal Kipper identifiers and target-specific keywords can be overwritten by user definitions [Bug] Internal Kipper identifiers and target-specific reserved identifiers/keywords can be overwritten by user definitions Jun 5, 2022
@Luna-Klatzer
Copy link
Member Author

Luna-Klatzer commented Jun 6, 2022

Fixed with #154

This was referenced Jun 7, 2022
@Luna-Klatzer Luna-Klatzer added this to the v0.8.0 milestone Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment