Handle cross-package callable fields during QIR codegen#3470
Open
idavis wants to merge 6 commits into
Open
Conversation
idavis
force-pushed
the
iadavis/fix-cross-package-fir-codegen
branch
from
July 17, 2026 13:20
5fe46e2 to
6485174
Compare
…tors and factories, including across package boundaries, defers capability checks until after QIR transforms for string entry expressions.
idavis
force-pushed
the
iadavis/fix-cross-package-fir-codegen
branch
from
July 17, 2026 13:20
6485174 to
a795900
Compare
idavis
marked this pull request as ready for review
July 17, 2026 14:24
idavis
requested review from
ScottCarda-MS,
amcasey,
billti and
swernli
as code owners
July 17, 2026 14:24
swernli
reviewed
Jul 17, 2026
|
|
||
| assert_eq!(source.name.as_ref(), "lib.qs"); | ||
| assert_eq!(&source.contents[span_start..span_end], "config.Apply(q)"); | ||
| assert_ne!(source.name.as_ref(), "OutOfBounds"); |
Collaborator
There was a problem hiding this comment.
This check is technically redudant, since the name is already verified to be equal to "lib.qs" above.
swernli
reviewed
Jul 17, 2026
Comment on lines
+25
to
+32
| if let Some(unit) = store.get(package_id) { | ||
| WithSource::from_map(&unit.sources, diagnostic.error) | ||
| } else { | ||
| WithSource::from_map( | ||
| &SourceMap::default(), | ||
| qsc_fir_transforms::PipelineError::MissingDiagnosticSourcePackage(diagnostic.package), | ||
| ) | ||
| } |
Collaborator
There was a problem hiding this comment.
while this is nicely defensive, I don't think this error case is needed. If the package id for the source of a transform error is not in the store, how did it get transformed in the first place? Seems like this can be changed to an expect and the MissingDiagnosticSourcePackage error removed entirely.
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.
Summary