Skip to content

Error on invalid declarations in type definitions. #18813

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
wants to merge 64 commits into
base: main
Choose a base branch
from

Conversation

edgarfgp
Copy link
Contributor

@edgarfgp edgarfgp commented Aug 3, 2025

Description

Fixes #10066

Checklist

  • Test cases added
  • Release notes entry updated

Copy link
Contributor

github-actions bot commented Aug 3, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/10.0.100.md
LanguageFeatures.fsi docs/release-notes/.Language/preview.md

@edgarfgp edgarfgp changed the title Warn when a module definition is encountered inside a type definition. Warn on invalid declarations in type definitions. Aug 14, 2025
@auduchinok
Copy link
Member

I strongly believe it should be an error, just like in #15334. If we're targeting a new language version, I propose we make it an error.

@edgarfgp
Copy link
Contributor Author

I strongly believe it should be an error, just like in #15334. If we're targeting a new language version, I propose we make it an error.

Im kind of in the same boat. Happy to change it. Just need @T-Gro blessing : )

Copy link
Member

@T-Gro T-Gro left a comment

Choose a reason for hiding this comment

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

Approved also with changing it from warn to error for users of languageversion=10.

@edgarfgp edgarfgp changed the title Warn on invalid declarations in type definitions. Error on invalid declarations in type definitions. Aug 14, 2025
@edgarfgp edgarfgp force-pushed the fix-10066 branch 2 times, most recently from 082655a to 17e2f1c Compare August 15, 2025 10:10
Copy link
Member

@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.

Great job, as always Edgar :)

@edgarfgp edgarfgp requested review from auduchinok and T-Gro August 15, 2025 15:30
@edgarfgp
Copy link
Contributor Author

@T-Gro Any chance I get some help updating the last failing .bsl tests. Im on a macOS and for some reason the use usual export TEST_UPDATE_BSL=1 & dotnet test does not work. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Compiler allows what looks like a module nested inside of a type, but isn't
6 participants