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
Original bug ID: 4905 Reporter: ksk Assigned to:@garrigue Status: closed (set by @garrigue on 2010-04-30T07:32:56Z) Resolution: won't fix Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general) Related to:#4053
Bug description
The following source (which contains only type declarations) takes a long time to be compiled.
type 'a t01 = [ c01 of 'a ] type 'a t02 = [ 'a t01 | c02 of 'a t02 ]
type 'a t03 = [ 'a t02 | c03 of 'a t03 ] type 'a t04 = [ 'a t03 | c04 of 'a t04 ]
type 'a t05 = [ 'a t04 | c05 of 'a t05 ] type 'a t06 = [ 'a t05 | c06 of 'a t06 ]
...
type 'a t16 = [ 'a t15 | `c16 of 'a t16 ]
The compilation time is exponential to the number of declaration.
It takes twice time when adding one more declaration.
We have no problem
if we use normal variants instead of polymorphic variant, or
if we do not use type variable.
The text was updated successfully, but these errors were encountered:
Type checking of polymorphic variants being inherently quadratic, this kind of code is indeed slow
to typecheck. I see no way to improve this easily.
Note however that your example does not compare directly to usual variants, as you are
using inheritance, which is available only for polymorphic variants.
Original bug ID: 4905
Reporter: ksk
Assigned to: @garrigue
Status: closed (set by @garrigue on 2010-04-30T07:32:56Z)
Resolution: won't fix
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Related to: #4053
Bug description
The following source (which contains only type declarations) takes a long time to be compiled.
type 'a t01 = [
c01 of 'a ] type 'a t02 = [ 'a t01 |
c02 of 'a t02 ]type 'a t03 = [ 'a t02 |
c03 of 'a t03 ] type 'a t04 = [ 'a t03 |
c04 of 'a t04 ]type 'a t05 = [ 'a t04 |
c05 of 'a t05 ] type 'a t06 = [ 'a t05 |
c06 of 'a t06 ]...
type 'a t16 = [ 'a t15 | `c16 of 'a t16 ]
The compilation time is exponential to the number of declaration.
It takes twice time when adding one more declaration.
We have no problem
The text was updated successfully, but these errors were encountered: