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

[WIP] - Suggestion: Don't implicitly append Module suffix if type with same name has type arguments. #1772

Merged
merged 1 commit into from
Nov 21, 2016
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
18 changes: 10 additions & 8 deletions src/fsharp/TypeChecker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16059,10 +16059,11 @@ and TcSignatureElementsNonMutRec cenv parent endm env defs =
[ for def in defs do
match def with
| SynModuleSigDecl.Types (typeSpecs,_) ->
for (TypeDefnSig(ComponentInfo(_,_,_,ids,_,_,_,_),trepr,extraMembers,_)) in typeSpecs do
match trepr with
| SynTypeDefnSigRepr.Simple((SynTypeDefnSimpleRepr.None _),_) when not (isNil extraMembers) -> ()
| _ -> yield (List.last ids).idText
for (TypeDefnSig(ComponentInfo(_,typars,_,ids,_,_,_,_),trepr,extraMembers,_)) in typeSpecs do
if isNil typars then
match trepr with
| SynTypeDefnSigRepr.Simple((SynTypeDefnSimpleRepr.None _),_) when not (isNil extraMembers) -> ()
| _ -> yield (List.last ids).idText
| _ -> () ]
|> set

Expand Down Expand Up @@ -16487,10 +16488,11 @@ and TcModuleOrNamespaceElements cenv parent endm env xml mutRecNSInfo defs =
[ for def in defs do
match def with
| SynModuleDecl.Types (typeSpecs,_) ->
for (TypeDefn(ComponentInfo(_,_,_,ids,_,_,_,_),trepr,_,_)) in typeSpecs do
match trepr with
| SynTypeDefnRepr.ObjectModel(TyconAugmentation,_,_) -> ()
| _ -> yield (List.last ids).idText
for (TypeDefn(ComponentInfo(_,typars,_,ids,_,_,_,_),trepr,_,_)) in typeSpecs do
if isNil typars then
match trepr with
| SynTypeDefnRepr.ObjectModel(TyconAugmentation,_,_) -> ()
| _ -> yield (List.last ids).idText
| _ -> () ]
|> set

Expand Down
4 changes: 2 additions & 2 deletions tests/fsharp/core/longnames/test.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ module Ok9b =
let create() = 1
type Dummy = A | B


test "lkneecec09iew9" (typeof<A.Dummy>.FullName.Contains("AModule") )
//A<'T> has a type parameter, so appending Module is not necessary.
test "lkneecec09iew9" (not (typeof<A.Dummy>.FullName.Contains("AModule") ) )

module rec Ok10 =

Expand Down