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

Better error reporting for let bindings. #17601

Merged
merged 44 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
523ccd9
Use `SynPat` range for let binding errors
edgarfgp Aug 24, 2024
619b4f6
update error range for tcAttributesAreNotPermittedOnLetBindings
edgarfgp Aug 24, 2024
912ab6d
Include typars
edgarfgp Aug 24, 2024
4e4f496
AP better error message
edgarfgp Aug 25, 2024
db78b2e
fantomas
edgarfgp Aug 25, 2024
730e980
Fix tests
edgarfgp Aug 25, 2024
4b7967e
fantomas
edgarfgp Aug 25, 2024
49c59fb
update tests
edgarfgp Aug 25, 2024
2ac08a7
Add a new compiler error for multi-case partial active patterns are n…
edgarfgp Aug 26, 2024
82254f4
use tcPartialActivePattern and add more tests
edgarfgp Aug 26, 2024
14b9b61
update tests
edgarfgp Aug 26, 2024
44c170b
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 26, 2024
3e6eb43
Update src/Compiler/FSComp.txt
edgarfgp Aug 26, 2024
e65f1c4
Update FSComp.txt
edgarfgp Aug 26, 2024
5ed584e
Update src/Compiler/FSComp.txt
edgarfgp Aug 26, 2024
998bf6b
Merge branch 'better-let-binding-error-range' of github.com:edgarfgp/…
edgarfgp Aug 26, 2024
4c9cbc0
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 26, 2024
924e17e
Merge branch 'better-let-binding-error-range' of github.com:edgarfgp/…
edgarfgp Aug 26, 2024
5518da5
more tests
edgarfgp Aug 26, 2024
9d887b6
release notes
edgarfgp Aug 26, 2024
a041fb7
Update xlf
edgarfgp Aug 26, 2024
714770f
reduce diff
edgarfgp Aug 26, 2024
1a7819b
update tests
edgarfgp Aug 27, 2024
d6a5137
baselines
edgarfgp Aug 27, 2024
0b544fb
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 27, 2024
fda8c6f
move `neg16.bsl` content to different tests
edgarfgp Aug 28, 2024
ae72626
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 28, 2024
8d94763
move `neg16.bsl` content to different tests
edgarfgp Aug 28, 2024
d7877ec
Merge branch 'better-let-binding-error-range' of github.com:edgarfgp/…
edgarfgp Aug 28, 2024
9decd9c
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 28, 2024
db40ac6
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 29, 2024
36d81d8
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 29, 2024
0e86a93
Update bsl
psfinaki Aug 30, 2024
2a10d3f
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 30, 2024
a79ce39
Update last failing tests.
edgarfgp Aug 30, 2024
b2a8f0b
Update last failing tests.
edgarfgp Aug 30, 2024
4e1ec09
Merge branch 'main' into better-let-binding-error-range
edgarfgp Aug 30, 2024
3cb5d6f
FactForDESKTOP neg16
edgarfgp Sep 2, 2024
cf4f57b
Merge branch 'better-let-binding-error-range' of github.com:edgarfgp/…
edgarfgp Sep 2, 2024
bd5c333
Merge branch 'main' into better-let-binding-error-range
edgarfgp Sep 3, 2024
843b522
fix bsl
psfinaki Sep 3, 2024
b266304
Merge branch 'main' into better-let-binding-error-range
edgarfgp Sep 3, 2024
f299048
Merge branch 'main' into better-let-binding-error-range
psfinaki Sep 3, 2024
0638148
Merge branch 'main' into better-let-binding-error-range
edgarfgp Sep 4, 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
504 changes: 257 additions & 247 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ tcUnnamedArgumentsDoNotFormPrefix,"The unnamed arguments do not form a prefix of
824,tcAttributesAreNotPermittedOnLetBindings,"Attributes are not permitted on 'let' bindings in expressions"
825,tcDefaultValueAttributeRequiresVal,"The 'DefaultValue' attribute may only be used on 'val' declarations"
826,tcConditionalAttributeRequiresMembers,"The 'ConditionalAttribute' attribute may only be used on members"
827,tcInvalidActivePatternName,"This is not a valid name for an active pattern"
827,tcInvalidActivePatternName,"'%s' is not a valid method name. Active patterns may only be defined as let-bound module or class functions."
edgarfgp marked this conversation as resolved.
Show resolved Hide resolved
828,tcEntryPointAttributeRequiresFunctionInModule,"The 'EntryPointAttribute' attribute may only be used on function definitions in modules"
829,tcMutableValuesCannotBeInline,"Mutable values cannot be marked 'inline'"
830,tcMutableValuesMayNotHaveGenericParameters,"Mutable values cannot have generic parameters"
Expand Down Expand Up @@ -1782,3 +1782,4 @@ 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."
9 changes: 9 additions & 0 deletions src/Compiler/SyntaxTree/PrettyNaming.fs
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,15 @@ type ActivePatternInfo =

member x.ActiveTagsWithRanges = let (APInfo(_, tags, _)) = x in tags

// FIXME
member x.LogicalName =
let (APInfo(isTotal, tags, _)) = x

tags
|> List.map fst
|> String.concat "|"
|> (fun s -> if isTotal then "(|" + s + "|)" else "(|" + s + "|_|)")

member x.Range = let (APInfo(_, _, m)) = x in m

let ActivePatternInfoOfValName nm (m: range) =
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/SyntaxTree/PrettyNaming.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ type internal ActivePatternInfo =

member ActiveTags: string list
member ActiveTagsWithRanges: (string * range) list
member LogicalName: string
member IsTotal: bool
member Range: range

Expand Down
9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.cs.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.de.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.es.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.fr.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.it.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.ja.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.ko.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.pl.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.pt-BR.xlf

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

9 changes: 7 additions & 2 deletions src/Compiler/xlf/FSComp.txt.ru.xlf

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

Loading
Loading