Skip to content
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
one more file
  • Loading branch information
smcl committed Jul 17, 2019
commit 3d5b9496c71a712bf356cd4a67b8db1a478094ce
45 changes: 45 additions & 0 deletions tests/fsharp/Compiler/ErrorMessages/NameResolutionTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.UnitTests

open NUnit.Framework
open FSharp.Compiler.SourceCodeServices

[<TestFixture>]
module NameResolutionTests =

[<Test>]
let FieldNotInRecord () =
CompilerAssert.TypeCheckSingleError
"""
type A = { Hello:string; World:string }
type B = { Size:int; Height:int }
type C = { Wheels:int }
type D = { Size:int; Height:int; Walls:int }
type E = { Unknown:string }
type F = { Wallis:int; Size:int; Height:int; }

let r:F = { Size=3; Height=4; Wall=1 }
"""
FSharpErrorSeverity.Error
1129
(9, 31, 9, 35)
"The record type 'F' does not contain a label 'Wall'."

[<Test>]
let RecordFieldProposal () =
CompilerAssert.TypeCheckSingleError
"""
type A = { Hello:string; World:string }
type B = { Size:int; Height:int }
type C = { Wheels:int }
type D = { Size:int; Height:int; Walls:int }
type E = { Unknown:string }
type F = { Wallis:int; Size:int; Height:int; }

let r = { Size=3; Height=4; Wall=1 }
"""
FSharpErrorSeverity.Error
39
(9, 29, 9, 33)
"The record label 'Wall' is not defined."
You are viewing a condensed version of this merge commit. You can view the full changes here.