You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to extend a record produced by an overloaded oper, type inference fails:
resource TestRes = {
oper
Rec: Type = {
a, b: Str ;
} ;
mkRec1: Str -> Rec =\a -> { a = a; b = a } ;
mkRec2: Str -> Str -> Rec =\a,b -> { a = a; b = b } ;
mkRec = overload {
mkRec: Str -> Rec = mkRec1 ;
mkRec: Str -> Str -> Rec = mkRec2 ;
} ;
r1: Rec = mkRec1 "A"** {a ="X"} ;-- ok
r2: Rec = mkRec2 "A""B"** {a ="X"} ;-- ok
r3: Rec = mkRec "A""B";-- ok
r4: Rec = mkRec "A""B"** {a ="X"} ;-- fails
r5: Rec =let r: Rec = mkRec "A""B"in r ** {a ="X"} ;-- ok
r6: Rec = <mkRec "A""B": Rec> ** {a ="X"} ;-- fails
}
Error for r4:
TestRes.gf:19:
Happened in operation r4
no overload instance of TestRes.mkRec
with value type {b : Str}
for argument list
Str Str
among alternatives
Str
Str Str
Error for r6:
TestRes.gf:23:
Happened in operation r6
no overload instance of TestRes.mkRec
with value type {a : Str; b : Str}
for argument list
Str Str
among alternatives
Str
Str Str
The text was updated successfully, but these errors were encountered:
Originally reported by Roman Suzi in gf-dev.
When trying to extend a record produced by an overloaded oper, type inference fails:
Error for
r4
:Error for
r6
:The text was updated successfully, but these errors were encountered: