Cadquos
Explore Marketplace Help
Register Sign In
Cadquos Development

Main Navigation

  • 🏠
    Dashboard
  • 🏢
    Organizations
    8
  • 📁
    Repositories
    8
  • 👥
    Team
  • 🗓️
    Calendar

Workspace

  • 📝
    작업메모
  • 🚀
    시작하기
  • 📝
    빠른 메모
  • 👻
    나의 공간
    3
  • 📝
    작업목록

  • Settings
  • Connections
  • Public Pages
  • Notifications
    3
  • Help Center

John Smith

john@example.com

ByoungSooPark/modeling-app
1
0
Fork 0
You've already forked modeling-app
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
095a7a575b69edb487b83c1352b4326c0377df5d
modeling-app/rust/kcl-lib/tests/var_ref_in_own_def/input.kcl

3 lines
86 B
Plaintext
Raw Normal View History

KCL: Fix 'cryptic' error when referencing a variable in its own declaration (#7325) Previously, `x = cos(x)` would just say "`x` is undefined". Now it says that `x` cannot be referenced in its own definition, try using a different variable instead. To do this, I've added a new `Option<String>` field to the mod-local executor context, tracking the current variable declaration. This means cloning some strings, implying a small performance hit. I think it's fine, for the better diagnostics. In the future we could refactor this to use a &str or store variable labels in stack-allocated strings like docs.rs/compact_str or something. Closes https://github.com/KittyCAD/modeling-app/issues/6072
2025-06-02 17:25:55 -05:00
// This won't work, because `x` is being referenced in its own definition.
x = cos(x)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.0+dev-176-gd179de641c Page: 44ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API