Open
Conversation
LindonAliu
reviewed
Dec 15, 2025
Member
LindonAliu
left a comment
There was a problem hiding this comment.
Can you add some tests for public or private items into struct and enum pls ?
721e6ae to
4f10a19
Compare
Snowy1803
reviewed
Dec 19, 2025
| node = node->getParent(); | ||
| } | ||
| return llvm::cast<ModuleDecl>(node); | ||
| return llvm::dyn_cast<ModuleDecl>(node); |
Member
There was a problem hiding this comment.
you're not supposed to call getModule on a node that isn't in the AST. all nodes in the AST have a module at the top level.
| llvm::Twine("Cannot access private field '") + memberName | ||
| + "' of struct '" + structType->getName() + "'" | ||
| ); | ||
| return ConstraintResult::Failed; |
Member
There was a problem hiding this comment.
You are within the constraint system, so this function will be called multiple times if there are multiple overloads within the statement.
So either:
- Put the diagnostic in a semantic pass, don't fail the CS here
- Fail the CS, put the diagnostic in the error recovery part of the CS
| llvm::SmallVector<Constraint *, 4> constraints; | ||
|
|
||
| // Check if access is through a namespace (like a::f) | ||
| bool isNamespaceAccess = !node->getIdentifiers().components.empty(); |
| isAllocated: Bool | ||
| public data: *Char, | ||
| public length: Int, | ||
| public isAllocated: Bool |
Member
There was a problem hiding this comment.
these shouldn't really be public. It should be internal to the string.glu file (there is not really a reason anymore to have separate string.glu and stringType.glu)
…-from-imported-namespaces-enum-cases-etc
…ts across modules
4f10a19 to
e54821e
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix #681