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

Too many targets #2388

Merged
merged 3 commits into from
Jun 2, 2017
Merged

Too many targets #2388

merged 3 commits into from
Jun 2, 2017

Conversation

0x53A
Copy link
Contributor

@0x53A 0x53A commented Jun 2, 2017

No description provided.

@0x53A
Copy link
Contributor Author

0x53A commented Jun 2, 2017

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
Copy link
Member

matthid commented Jun 2, 2017

Maybe we should do this in installmodel?

@0x53A
Copy link
Contributor Author

0x53A commented Jun 2, 2017

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

@matthid
Copy link
Member

matthid commented Jun 2, 2017

;)

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

0x53A commented Jun 2, 2017

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

@matthid
Copy link
Member

matthid commented Jun 2, 2017

@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.

None yet

2 participants