Skip to content
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

RFC FS-1033: Deprecate places where seq can be omitted #17772

Merged
merged 29 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d643cfb
Treat `{ 1..10 }` as sequence expression
edgarfgp Sep 20, 2024
4d45b1a
deprecate { start..finish } and { start..step..finish }
edgarfgp Sep 21, 2024
47b4ef0
fix build part1
edgarfgp Sep 22, 2024
bce0a69
3873., chkDeprecatePlacesWhereSeqCanBeOmitted
edgarfgp Sep 22, 2024
37b5ab8
more tests
edgarfgp Sep 22, 2024
a731f2f
release notes
edgarfgp Sep 22, 2024
0d13e00
reorg seq tests
edgarfgp Sep 22, 2024
4d116c0
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Sep 23, 2024
2b48aca
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Sep 23, 2024
bcc360a
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Sep 25, 2024
a3b6198
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Sep 26, 2024
45ab45e
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Sep 28, 2024
de89b44
Better check
edgarfgp Sep 28, 2024
ba7d1a0
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Sep 28, 2024
26febc9
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Sep 30, 2024
4850ff8
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Oct 1, 2024
01414b4
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Oct 4, 2024
52e310b
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Oct 8, 2024
10dc2ee
fix merge conflicts
edgarfgp Oct 8, 2024
8f39d7b
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Oct 10, 2024
bd24e47
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Oct 12, 2024
d67bae4
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Oct 16, 2024
c8f85bc
Merge branch 'main' into improve-sequence-expr-inference
edgarfgp Oct 18, 2024
0795506
Add code fix for adding missing `seq` before `{…}`
brianrourkeboll Oct 19, 2024
3e0c4c7
More tests
brianrourkeboll Oct 19, 2024
6f46629
Fmt
brianrourkeboll Oct 19, 2024
e289e2a
Merge pull request #8 from brianrourkeboll/missing-seq-code-fix
edgarfgp Oct 19, 2024
f698c11
update release notes
edgarfgp Oct 19, 2024
9d24c54
more editor tests
edgarfgp Oct 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Fix nullness inference for member val and other OO scenarios ([PR #17845](https://github.com/dotnet/fsharp/pull/17845))

### Added

* Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772))
* Support literal attribute on decimals ([PR #17769](https://github.com/dotnet/fsharp/pull/17769))

### Changed
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.Language/preview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Added

* Better generic unmanaged structs handling. ([Language suggestion #692](https://github.com/fsharp/fslang-suggestions/issues/692), [PR #12154](https://github.com/dotnet/fsharp/pull/12154))
* Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772))

### Fixed

Expand Down
8 changes: 8 additions & 0 deletions docs/release-notes/.VisualStudio/17.13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Fixed

### Added
* Code fix for adding missing `seq`. ([PR #17772](https://github.com/dotnet/fsharp/pull/17772))

### Changed

### Breaking Changes
11 changes: 11 additions & 0 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5891,6 +5891,17 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
TcForEachExpr cenv overallTy env tpenv (seqExprOnly, isFromSource, pat, synEnumExpr, synBodyExpr, m, spFor, spIn, m)

| SynExpr.ComputationExpr (hasSeqBuilder, comp, m) ->
let isIndexRange = match comp with | SynExpr.IndexRange _ -> true | _ -> false
let deprecatedPlacesWhereSeqCanBeOmitted =
cenv.g.langVersion.SupportsFeature LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted
if
deprecatedPlacesWhereSeqCanBeOmitted
&& isIndexRange
&& not hasSeqBuilder
&& not cenv.g.compilingFSharpCore
then
warning (Error(FSComp.SR.chkDeprecatePlacesWhereSeqCanBeOmitted (), m))

let env = ExitFamilyRegion env
cenv.TcSequenceExpressionEntry cenv env overallTy tpenv (hasSeqBuilder, comp) m

Expand Down
4 changes: 3 additions & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1783,4 +1783,6 @@ featureEmptyBodiedComputationExpressions,"Support for computation expressions wi
featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters"
3871,tcAccessModifiersNotAllowedInSRTPConstraint,"Access modifiers cannot be applied to an SRTP constraint."
featureAllowObjectExpressionWithoutOverrides,"Allow object expressions without overrides"
3872,tcPartialActivePattern,"Multi-case partial active patterns are not supported. Consider using a single-case partial active pattern or a full active pattern."
3872,tcPartialActivePattern,"Multi-case partial active patterns are not supported. Consider using a single-case partial active pattern or a full active pattern."
3873,chkDeprecatePlacesWhereSeqCanBeOmitted,"This construct is deprecated. Sequence expressions should be of the form 'seq {{ ... }}'"
featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be omitted"
3 changes: 3 additions & 0 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type LanguageFeature =
| ParsedHashDirectiveArgumentNonQuotes
| EmptyBodiedComputationExpressions
| AllowObjectExpressionWithoutOverrides
| DeprecatePlacesWhereSeqCanBeOmitted

/// LanguageVersion management
type LanguageVersion(versionText) =
Expand Down Expand Up @@ -219,6 +220,7 @@ type LanguageVersion(versionText) =
LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work
LanguageFeature.AllowAccessModifiersToAutoPropertiesGettersAndSetters, previewVersion
LanguageFeature.AllowObjectExpressionWithoutOverrides, previewVersion
LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, previewVersion
]

static let defaultLanguageVersion = LanguageVersion("default")
Expand Down Expand Up @@ -375,6 +377,7 @@ type LanguageVersion(versionText) =
| LanguageFeature.ParsedHashDirectiveArgumentNonQuotes -> FSComp.SR.featureParsedHashDirectiveArgumentNonString ()
| LanguageFeature.EmptyBodiedComputationExpressions -> FSComp.SR.featureEmptyBodiedComputationExpressions ()
| LanguageFeature.AllowObjectExpressionWithoutOverrides -> FSComp.SR.featureAllowObjectExpressionWithoutOverrides ()
| LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted -> FSComp.SR.featureDeprecatePlacesWhereSeqCanBeOmitted ()

/// Get a version string associated with the given feature.
static member GetFeatureVersionString feature =
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type LanguageFeature =
| ParsedHashDirectiveArgumentNonQuotes
| EmptyBodiedComputationExpressions
| AllowObjectExpressionWithoutOverrides
| DeprecatePlacesWhereSeqCanBeOmitted

/// LanguageVersion management
type LanguageVersion =
Expand Down
12 changes: 11 additions & 1 deletion src/Compiler/xlf/FSComp.txt.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/Compiler/xlf/FSComp.txt.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/Compiler/xlf/FSComp.txt.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/Compiler/xlf/FSComp.txt.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/Compiler/xlf/FSComp.txt.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/Compiler/xlf/FSComp.txt.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/Compiler/xlf/FSComp.txt.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading