-
Notifications
You must be signed in to change notification settings - Fork 832
Fix nativeptr type erasure to preserve element type in overload resolution #18911
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
Open
Copilot
wants to merge
18
commits into
main
Choose a base branch
from
copilot/fix-24b59ebb-af21-49f7-96cf-02e1313f6ac1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+87
−13
Open
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
61afb60
Initial plan
Copilot a675546
Implement nativeptr type erasure fix and add regression tests
Copilot 45454cc
Add release notes for nativeptr type erasure fix
Copilot c80d185
Update tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarE…
T-Gro 51a01bc
Update tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarE…
T-Gro 852392b
Fix test expectations to match actual compiler behavior for duplicate…
Copilot 8106b4b
Restore both error expectations for duplicate method tests
Copilot 21a836c
Merge branch 'main' into copilot/fix-24b59ebb-af21-49f7-96cf-02e1313f…
T-Gro b880750
Fix test expectations to expect only second duplicate method error
Copilot 03fa74b
Merge branch 'main' into copilot/fix-24b59ebb-af21-49f7-96cf-02e1313f…
T-Gro da6ba12
Restore expecting both duplicate method errors as reported by compiler
Copilot 7952397
Merge branch 'main' into copilot/fix-24b59ebb-af21-49f7-96cf-02e1313f…
T-Gro 6ddbcb9
Merge branch 'main' into copilot/fix-24b59ebb-af21-49f7-96cf-02e1313f…
T-Gro fd49e47
adjust tests
T-Gro 661149d
Reflect older tests
T-Gro 5a32006
Merge branch 'main' into copilot/fix-24b59ebb-af21-49f7-96cf-02e1313f…
T-Gro 225c9a8
release notes
T-Gro 40fe55f
Merge branch 'copilot/fix-24b59ebb-af21-49f7-96cf-02e1313f6ac1' of ht…
T-Gro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
9 changes: 9 additions & 0 deletions
9
...ormance/BasicGrammarElements/MemberDefinitions/OverloadingMembers/NativePtrOverloads01.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| module NativePtrOverloads01 | ||
| open Microsoft.FSharp.NativeInterop | ||
| #nowarn "9" | ||
|
|
||
| type P = | ||
| static member Do(p: nativeptr<int>) = 1 | ||
| static member Do(p: nativeptr<int64>) = 2 | ||
|
|
||
| let _invoke (pi: nativeptr<int>) (pl: nativeptr<int64>) = P.Do pi + P.Do pl |
7 changes: 7 additions & 0 deletions
7
...ormance/BasicGrammarElements/MemberDefinitions/OverloadingMembers/NativePtrOverloads02.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module NativePtrOverloads02 | ||
| open Microsoft.FSharp.NativeInterop | ||
| #nowarn "9" | ||
|
|
||
| type Q = | ||
| static member M(p: nativeptr<int>) = 0 | ||
| static member M(p: nativeptr<int>) = 1 // expect duplicate member error |
8 changes: 8 additions & 0 deletions
8
...ormance/BasicGrammarElements/MemberDefinitions/OverloadingMembers/NativePtrOverloads03.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| module NativePtrOverloads03 | ||
| open Microsoft.FSharp.NativeInterop | ||
| #nowarn "9" | ||
| // Regression test for issue #<ISSUE_NUMBER> | ||
|
|
||
| type R = | ||
| static member F(p: nativeptr<uint16>) = 0us | ||
| static member F(p: nativeptr<int64>) = 0L |
9 changes: 9 additions & 0 deletions
9
...ormance/BasicGrammarElements/MemberDefinitions/OverloadingMembers/NativePtrOverloads04.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| module NativePtrOverloads04 | ||
| open Microsoft.FSharp.NativeInterop | ||
| #nowarn "9" | ||
| [<Measure>] type kg | ||
| [<Measure>] type m | ||
|
|
||
| type S = | ||
| static member H(p: nativeptr<int<kg>>) = 1 | ||
| static member H(p: nativeptr<int<m>>) = 2 // expect duplicate member error |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.