Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1334,10 +1334,10 @@ module MutRecBindingChecking =

// Phase2B: typecheck the argument to an 'inherits' call and build the new object expr for the inherit-call
| Phase2AInherit (synBaseTy, arg, baseValOpt, m) ->
let baseTy, tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Use WarnOnIWSAM.Yes envInstance tpenv synBaseTy
let baseTy = baseTy |> convertToTypeWithMetadataIfPossible g
let inheritsExpr, tpenv =
try
try
let baseTy, tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Use WarnOnIWSAM.Yes envInstance tpenv synBaseTy
let baseTy = baseTy |> convertToTypeWithMetadataIfPossible g
TcNewExpr cenv envInstance tpenv baseTy (Some synBaseTy.Range) true arg m
with RecoverableException e ->
errorRecovery e m
Expand Down
11 changes: 11 additions & 0 deletions tests/service/Symbols.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,3 +1123,14 @@ let z = builder
if symbolUse.Symbol.DisplayName = "builder" then
(symbolUse.Range.StartLine, symbolUse.Range.StartColumn), symbolUse.IsFromComputationExpression
]

module Member =
[<Test>]
let ``Inherit 01`` () =
let _, checkResults = getParseAndCheckResults """
type T() =
inherit Foo()

let i = 1
"""
assertHasSymbolUsages ["i"] checkResults