-
Notifications
You must be signed in to change notification settings - Fork 830
Do not infer record fields if the LRH type is already known #3584
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
Do not infer record fields if the LRH type is already known #3584
Conversation
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.
Looks good.
|
wait |
|
OK, it's really great :) (I tried to use match adhoctDotSearchAccessible with
// If the type is already known, we should not try to lookup a record field
| Exception _ when isRecdTy ncenv.g typ -> but it broke everything). |
|
@dotnet-bot test this please |
|
@vasily-kirichenko breaking everything is a small price to pay for It's great .... |
|
The current version seems to work OK. I'm not sure if this is the right solution because Don suggested to use |
|
@vasily-kirichenko As I explained in #3576 (comment) "isRecordTy" is not enough. The type can be a type variable too (e.g. |
|
@vasily-kirichenko Yes, what you have now should be enough |
…d-fields-if-type-is-known
|
@dotnet-bot test Windows_NT Release_ci_part2 Build please |
…d-fields-if-type-is-known
This reverts commit 03dcb7b.
|
it's ready |
src/fsharp/NameResolution.fs
Outdated
| // If the type is already known, we should not try to lookup a record field | ||
| if isAppTy ncenv.g typ then | ||
| NoResultsOrUsefulErrors | ||
| else match lid with |
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.
Minor nit: this is odd code formatting for the compiler. We would normally use
if X then
Y
else
match Z with
or
if X then Y else
match Z with
dsyme
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.
I will mark as approved, but we should normally always add a test for this kind of change. Add it in tests\fsharp\typecheck\sigs
|
Done. |
|
@dotnet-bot test this please |
This fixes #3574 and #3576