[pull] master from GaijinEntertainment:master#993
Merged
Conversation
It's useful to be able to not repeat yourself. If tuple names exactly match variable names we want to assign we should allow to write unnamed tuple. See tests for more details.
Support unnamed -> named promotion for return tuples as well.
`def float(...)`, `def int(...)`, `def double(...)`, `def do(...)` were rejected with error[30163] "invalid function name" — surprising next to `def string(...)` and `def float2(...)`, which compiled fine. The parser accepts all of them (function_name → das_type_name); a post-parse lint guard was the gate, rejecting any name in a hardcoded C++-keyword set. The asymmetry was just that set: `float` / `int` / `double` are C++ keywords, but `float2` / `string` / `int2` aren't. Drop the function-name guard and have the AOT emitter mangle keyword names the same way it already mangles operator overloads. - daslib/aot_cpp.das: aotSuffixNameEx now seeds prefix = is_cpp_keyword, so `def float` AOTs to `_Funcfloat_<hash>` (valid C++) instead of literal `float`. - src/ast/ast_lint.cpp: remove isValidFunctionName + its callsite. The other 5 isCppKeyword guards (module/enum/enum-value/struct/field) stay — those embed 1:1 into C++ and need the guard. - tests/language/failed_reserved_names.das: drop the `def do` case and 30163 from the expect line. - tests/aot/test_cpp_keyword_names.das: positive test exercising `def float`/`def int`/`def double`/`def do` via interpreter, AOT, and JIT. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…eyword-function-names infer/aot: allow C++-keyword function names via AOT name-mangling
…amed-tuple-conv compiler: allow unnamed -> named tuples conversions on name match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )