Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006922OCamltypingpublic2015-07-02 23:572017-08-02 08:05
Reporterjhw 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version4.03.0+dev / +beta1 
Target VersionFixed in Version 
Summary0006922: Regression with -principal type inference
DescriptionRegression with -principal type inference.
Steps To ReproduceCompile the debug configuration of v1.0.11 of the Oni package, which uses -principal and -warn-error A. With OCaml 4.02, this succeeds. With current 4.03+trunk, this fails because of "type not principal" warnings (errors) in Cf_journal and Cf_gadget.
Additional InformationThe source code for the Oni package is on Bitbucket at <https://bitbucket.org/jhw/oni>. [^]
TagsNo tags attached.
Attached Files? file icon type_error.ml [^] (6,886 bytes) 2017-04-06 21:53 [Show Content]

- Relationships

-  Notes
(0014185)
garrigue (manager)
2015-07-04 10:32

You should probably report this first to the authors of Oni: a released package should never use -warn-error A, as this may break when warnings become stricter.
Then the authors of this package should check whether the warnings make sense or not.
(0014186)
jhw (reporter)
2015-07-06 19:18

Jacques, I am the author of the Oni package. The release configuration of the package doesn't use -warn-error A or -principle. Only the debug configuration does. I have a patch that works around the problem I'm reporting at the cost of losing the generality afforded by polymorphic methods, I'm hoping to discover that I won't need it because this problem turns out indeed to be a regression in 4.03. On the other hand, it may turn out that 4.03 actually has an improved type checker and my previously logic should never have been accepted when -principle is used. I'm interested to know which it will be.
(0014191)
garrigue (manager)
2015-07-07 16:37

Can you provide a shorter repro case?
I'm still trying to have omake working here...
(0014345)
jhw (reporter)
2015-08-16 21:54

I haven't forgotten about this. Just gotten busy with mundane seasonal distractions.
(0015921)
jhw (reporter)
2016-05-12 22:56

I was able to work around this problem in the release of Oni 1.0.12 with the following commit. I'm not sure if the workaround should be necessary.

https://bitbucket.org/jhw/oni/commits/ac4738c26d52228db1c69382d5ef1842db9d0b3b [^]
(0017651)
garrigue (manager)
2017-03-14 11:25

Still waiting to see whether this is really a regression or not.
(0017727)
jhw (reporter)
2017-04-06 21:54

Uploaded a test file. Work around is commented out.

$ ocamlc -principal -warn-error A -i -c type_error.ml
File "type_error.ml", line 184, characters 12-20:
Warning 18: this use of a polymorphic method is not principal.
File "type_error.ml", line 188, characters 12-20:
Warning 18: this use of a polymorphic method is not principal.
File "type_error.ml", line 192, characters 12-20:
Warning 18: this use of a polymorphic method is not principal.
File "type_error.ml", line 196, characters 12-20:
Warning 18: this use of a polymorphic method is not principal.
File "type_error.ml", line 200, characters 12-20:
Warning 18: this use of a polymorphic method is not principal.
File "type_error.ml", line 204, characters 12-20:
Warning 18: this use of a polymorphic method is not principal.
File "type_error.ml", line 208, characters 12-20:
Warning 18: this use of a polymorphic method is not principal.
(0018157)
garrigue (manager)
2017-08-02 08:05

Apparently, inherited methods are not properly marked as known.

Here is a lighter workaround for now : in basic_agent, add

        method private virtual put:
            'a 'b. 'level -> ('event -> 'b) ->
            ('a, unit, string, 'b) format4 -> 'a

- Issue History
Date Modified Username Field Change
2015-07-02 23:57 jhw New Issue
2015-07-04 10:32 garrigue Note Added: 0014185
2015-07-04 10:32 garrigue Assigned To => garrigue
2015-07-04 10:32 garrigue Status new => feedback
2015-07-06 19:18 jhw Note Added: 0014186
2015-07-06 19:18 jhw Status feedback => assigned
2015-07-07 16:37 garrigue Note Added: 0014191
2015-07-07 16:37 garrigue Status assigned => feedback
2015-07-22 16:20 doligez Category Incoming => OCaml typing
2015-07-22 16:20 doligez Product Version 4.02.2 => 4.03.0+dev / +beta1
2015-07-22 16:20 doligez Summary 4.03+trunk => Regression with -principal type inference
2015-07-22 16:20 doligez Description Updated View Revisions
2015-07-22 16:20 doligez Steps to Reproduce Updated View Revisions
2015-07-22 16:20 doligez Target Version => 4.03.0+dev / +beta1
2015-08-16 21:54 jhw Note Added: 0014345
2015-08-16 21:54 jhw Status feedback => assigned
2016-04-15 16:08 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2016-05-12 22:56 jhw Note Added: 0015921
2017-02-16 14:00 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:45 doligez Category OCaml typing => typing
2017-03-14 11:25 garrigue Note Added: 0017651
2017-03-14 11:25 garrigue Status assigned => feedback
2017-03-15 15:25 doligez Target Version undecided =>
2017-04-06 21:53 jhw File Added: type_error.ml
2017-04-06 21:54 jhw Note Added: 0017727
2017-04-06 21:54 jhw Status feedback => assigned
2017-08-02 08:05 garrigue Note Added: 0018157


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker