-
Notifications
You must be signed in to change notification settings - Fork 854
Open
Labels
AI-thinks-issue-fixedArea-Compiler-Optionscompiler option processingcompiler option processingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
Repro steps
Try to compile the following program. Project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<OtherFlags>--checked+</OtherFlags>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
</Project>
Program.fs:
open System.ComponentModel
[<EntryPoint>]
[<System.ComponentModel.DefaultValue("test" + "ing")>]
let main argv =
0
Expected behavior
It compiles successfully, just as it does without --checked+
Actual behavior
Compiler error on the [<System.ComponentModel.DefaultValue("test" + "ing")>] line:
Program.fs(4,16): error FS0267: This is not a valid constant expression or custom attribute value
Known workarounds
None, other than not enabling overflow checking.
Related information
F# Compiler version 11.0.0.0 for F# 5.0
- Operating system: Windows 7 x64
- .NET Runtime kind: .NET 5.0.4
- Editing Tools: VS 2019, Rider
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AI-thinks-issue-fixedArea-Compiler-Optionscompiler option processingcompiler option processingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
New