Skip to content

Conversation

@auduchinok
Copy link
Member

@auduchinok auduchinok commented Jun 8, 2019

Fixes the compiler stopping type checking the whole recursive module/namespace when it cannot resolve namespace/module in an open declaration.

Instead of raising an exception and effectively stopping the type checking it now reports the error to the logger and continues checking without adding the open declaration to the environment.

Before:
Screenshot 2019-06-09 at 00 45 05

After:
Screenshot 2019-06-09 at 00 43 13

An example of what it looked like with a bigger file. Screenshot 2019-05-30 at 20 04 48

Copy link
Contributor

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

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

Thank you.

Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

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

@auduchinok I assume that code that relies on types defined in one of the erroneously-expressed opens yield an error about not knowing what the type is?

It's also worth noting that this does increase compile times for things that fail to compile. But I think that's probably marginal and the benefit for tools certainly seems like it would be greater than any hit to performance since people generally expect the perfectly valid F# code to typecheck and colorize correctly.

@auduchinok
Copy link
Member Author

@cartermp Yes, as it just doesn't import the module/namespace. It seems it does it the same way for non-recursive modules, although I didn't check the implementation.

@cartermp
Copy link
Contributor

@auduchinok Sounds good. Thanks!

@KevinRansom KevinRansom merged commit 8e0565f into dotnet:master Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants