Skip to content

Too many targets - #2388

Merged
matthid merged 3 commits into
fsprojects:hotfixfrom
0x53A:too-many-targets
Jun 2, 2017
Merged

matthid merged 3 commits into
fsprojects:hotfixfrom
0x53A:too-many-targets

Conversation

@0x53A

@0x53A 0x53A commented Jun 2, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@0x53A

0x53A commented Jun 2, 2017

Copy link
Copy Markdown
Contributor Author

Can someone please tell me why my commit fails with

InstallProcess.fs(167, 65): [FS0072] Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. NuGetV2.fs(642, 22): [FS0001] This expression was expected to have type� 'PackageName' �but here has type� ''a * 'b'

but the following code works in fsi:

open System

[<System.Diagnostics.DebuggerDisplay("{ToString()}")>]
[<CustomEquality;CustomComparison>]
type PackageName =
| PackageName of string * string

    member this.GetCompareString() =
        match this with
        | PackageName(_,id) -> id

    override this.ToString() = 
        match this with
        | PackageName(name,_) -> name

    override this.Equals(that) = 
        match that with
        | :? PackageName as that -> this.GetCompareString() = that.GetCompareString()
        | _ -> false

    override this.GetHashCode() = hash (this.GetCompareString())

    interface System.IComparable with
       member this.CompareTo that = 
          match that with 
          | :? PackageName as that -> StringComparer.Ordinal.Compare(this.GetCompareString(), that.GetCompareString())
          | _ -> invalidArg "that" "cannot compare value of different types"

let GetTargetsFiles(targetFolder, (pkg : PackageName)) =
    let (PackageName(packageName, packageId)) = pkg
    0;;

? ¯\_(ツ)_/¯

@0x53A
0x53A changed the base branch from master to hotfix June 2, 2017 01:40
@0x53A 0x53A closed this Jun 2, 2017
@0x53A 0x53A reopened this Jun 2, 2017
@matthid

matthid commented Jun 2, 2017

Copy link
Copy Markdown
Member

Maybe we should do this in installmodel?

@0x53A

0x53A commented Jun 2, 2017

Copy link
Copy Markdown
Contributor Author

Feel free, I'm going to sleep. =)

@matthid

matthid commented Jun 2, 2017

Copy link
Copy Markdown
Member

;)

@matthid
matthid merged commit c2ec78e into fsprojects:hotfix Jun 2, 2017
@matthid matthid mentioned this pull request Jun 2, 2017
@0x53A

0x53A commented Jun 2, 2017

Copy link
Copy Markdown
Contributor Author

I made some changes in a file nugetv2.fs. Anything I additionally need to change for v3? @matthid

@matthid

matthid commented Jun 2, 2017

Copy link
Copy Markdown
Member

@0x53A No I don't think so. The names are a bit confusing there... Could probably need some refactoring

@0x53A
0x53A deleted the too-many-targets branch June 2, 2017 13:57
@matthid matthid mentioned this pull request Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants