Repository navigation
Closed
Labels
Milestone
Description
While writing #8521 I came across this magnificent internal error while copying and editing some code:
type Foo =
static member Bar (x: int) = ()
static member Bar (x: bool) = ()
static member inline Invoke< ^N, 'a, 'b when (Foo or ^N): (static member Bar: 'a -> 'b)> source =
let inline call (_: ^M, a) =
((^M or ^N): (static member Bar: _ -> _)(a))
call (Unchecked.defaultof<Foo>, source)
type Hober =
static member Hoberator (x: int) = ()
static member Hoberator (x: bool) = ()
static member inline Invoke< ^N, 'a, 'b when (Hober or ^N): (static member Hoberator: 'a -> 'b)> source =
let inline call (_: ^M, a) =
((^M or ^N): (static member Hoberator: _ -> _)(a))
call (Unchecked.defaultof<Foo>, source)
error FS0043: A type parameter is missing a constraint 'when (Foo or ^N) : (static member Hoberator : '?1539481 -> '?1539482)'
error FS0073: internal error: couldn't remap internal value 'Hoberator'
error FS0073: internal error: couldn't remap internal value 'Hoberator'
error FS0073: internal error: couldn't remap internal value 'Invoke'
error FS0073: internal error: couldn't remap internal tycon type Hober <> =
class
end
with
Hoberator : int -> unit
! compiled_name! = Hoberator
membInfo-slotsig! = []
# arity<0>[1]
Hoberator : bool -> unit
! compiled_name! = Hoberator
membInfo-slotsig! = []
# arity<0>[1]
Invoke : !< ^_N when ^_N : trait
^_N : trait,'_a,'_b> '_?1539481 -> '_?1539482
! compiled_name! = Invoke
membInfo-slotsig! = []
# arity<3>[1]
end
Activity
[-]Internal error: couldn't remap internal tycon type Foo <>[/-][+]Internal error: couldn't remap internal tycon type Hober <>[/+]dsyme commentedon Aug 31, 2020
I've linked to this from #6805 as we should test w.r.t. that body of work
dsyme commentedon Sep 28, 2021
I don't repro the internal error any more with F# 5.0