Skip to content

Conversation

@auduchinok
Copy link
Member

Here's an experiment to see what breaks in CI.

@auduchinok auduchinok requested a review from a team as a code owner July 21, 2023 14:59
@auduchinok auduchinok changed the title Name resolution symbols interface2 Name resolution: experiment with resolving interfaces in expressions Jul 21, 2023
@T-Gro
Copy link
Member

T-Gro commented Jul 27, 2023

Is this still an experiment, or ready for review?

I have a feeling that the typecheck error reported now is worse from understandability points of view => I would need convincing that the tradeoff is worth it.

@auduchinok
Copy link
Member Author

auduchinok commented Jul 27, 2023

@T-Gro This is currently still an experiment. I'm currently on vacation and going to get back to it afterwards.

The general idea here is to provide symbols (with the type arguments where possible) and have better errors for unfinished expressions like:

// module/class/record/union
List
List.

// interface
IList
IList<_>
IList<int>

Currently no symbols are provided and the errors are misleading. This experiment already improves things for some of these cases, but needs further work.

The change in the tests is mostly about quite a corner case related to incorrect type definitions, and the previous error about constructors is also misleading. I'm going to look into improving it; maybe I'll just try to reuse this error.

@0101 0101 marked this pull request as draft July 31, 2023 17:11
@auduchinok
Copy link
Member Author

auduchinok commented Dec 10, 2023

I have a feeling that the typecheck error reported now is worse from understandability points of view => I would need convincing that the tradeoff is worth it.

@T-Gro I think they're actually better. The most of the updated baselines capture cases where there's a type that can't be instantiated properly due to an issue in its declaration, and previous errors would say that the types are undefined (which is not true and is misleading) while the newer errors say that the types are used in a wrong way, which is probably good enough considering that a fix is needed on the declaration side, and there's an appropriate error reported for the declaration.

@auduchinok auduchinok force-pushed the nameResolution-symbols-interface2 branch from 33e4b4d to 51f31c8 Compare December 10, 2023 08:25
@auduchinok auduchinok changed the title Name resolution: experiment with resolving interfaces in expressions Name resolution: resolve interfaces in expressions Dec 11, 2023
@auduchinok auduchinok marked this pull request as ready for review December 11, 2023 21:18
@auduchinok
Copy link
Member Author

auduchinok commented Dec 11, 2023

This is ready. It changes the way how wrong usages of interfaces are encoded in name resolution items, but it looks good and makes interface items more inline with rest of the types by removing the special case.

Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm I guess the resulting message could be clearer but IMO the new way it is not worse than what used to be. Okay with me.

@psfinaki
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@psfinaki
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@psfinaki
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@psfinaki
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@auduchinok auduchinok force-pushed the nameResolution-symbols-interface2 branch from 3d596c8 to b96fa07 Compare December 19, 2023 19:05
@auduchinok
Copy link
Member Author

This is green now.

@psfinaki psfinaki merged commit 1df1433 into dotnet:main Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants