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 there is a type error in a functor definition,
where the functor is then applied to produce a structure,
there is a confusing error message about the functor
application:
Error: structure A defined by partially applied functor
Transcript
- local
= functor F() : sig val x : int end = struct val x = "abs" end
= in
= structure A = F()
= end;
stdIn:2.11-2.63 Error: value type in structure does not match signature spec
name: x
spec: int
actual: string
stdIn:4.17-4.20 Error: structure A defined by partially applied functor
Expected Behavior
No response
Steps to Reproduce
local
functor F() : sig val x : int end = struct val x = "abs" end
in
structure A = F()
end;
Submitted via web form by John Reppy jhr@cs.uchicago.edu on 2020-37-31 at 17:3700
Keywords: modules
comment by @dmacqueen on 2020-55-25 00:5500 +000 UTC
The problem is that the check for a partially applied functor in a structure declaration (around line 1254 in elabmod.sml) is inaccurate when the functor declaration produces an error. A proper fix will require a somewhat delicate propagation of ERROR values (ERRORstr and ERRORfct) during module elaboration. The propagation needs to be more thorough, but not so aggressive that type checking is left out in other parts of the structures with bogus components.
The text was updated successfully, but these errors were encountered:
Version
110.96
Operating System
OS Version
No response
Processor
No response
Component
Core system
Severity
Cosmetic
Description of the problem
When there is a type error in a functor definition,
where the functor is then applied to produce a structure,
there is a confusing error message about the functor
application:
Error: structure A defined by partially applied functor
Transcript
Expected Behavior
No response
Steps to Reproduce
local
functor F() : sig val x : int end = struct val x = "abs" end
in
structure A = F()
end;
Additional Information
No response
Email address
jhr@cs.uchicago.edu
Comments from smlnj-gforge
Original smlnj-gforge bug number 246
Submitted via web form by John Reppy jhr@cs.uchicago.edu on 2020-37-31 at 17:3700
Keywords: modules
comment by @dmacqueen on 2020-55-25 00:5500 +000 UTC
The problem is that the check for a partially applied functor in a structure declaration (around line 1254 in elabmod.sml) is inaccurate when the functor declaration produces an error. A proper fix will require a somewhat delicate propagation of ERROR values (ERRORstr and ERRORfct) during module elaboration. The propagation needs to be more thorough, but not so aggressive that type checking is left out in other parts of the structures with bogus components.
The text was updated successfully, but these errors were encountered: