-
Notifications
You must be signed in to change notification settings - Fork 835
Fixed consuming CSharp interface with an inref parameter #8287
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
Conversation
| | TestCompilationReference (cmpl) -> | ||
| let tmp = Path.GetTempFileName() | ||
| disposals.Add({ new IDisposable with | ||
| member _.Dispose() = | ||
| try File.Delete tmp with | _ -> () }) | ||
| cmpl.EmitAsFile tmp | ||
| (([||], tmp), []), false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it this was just leaving stuff around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all new, so nothing was being left around before. But yes, once I create a tmp file, I need to make sure we always try to delete it on dispose.
| type CompilationReference = | ||
| private |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: type private is more idiomatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type private makes the whole type private which is not what I want. I only want to make the union cases private to the module.
KevinRansom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
* Added inref interop test * Fixed inref interop when creating a slot sig * 3.1 to 3.0
Should resolve this: davidfowl/BedrockFramework#48
Fix was easy, hardest part was making the test.
When importing an ILType when creating a TSlotParam, we didn't take into account the attributes, which there is a specific function for that. The attributes will dictate what kind of type we have, such as a
byrefparameter type with aReadOnlyAttribute; turns intoinref.