Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006379OCamlOCaml generalpublic2014-04-24 00:482014-06-10 11:12
Reporterlpw25 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionopen 
PlatformOSOS Version
Product Version4.01.0 
Target Version4.02.0+devFixed in Version4.02.0+dev 
Summary0006379: -dtypedtree is not defined for class fields
Descriptionprinttyped.ml has a stubbed out printer for class fields. So you get an assertion failure if you use -dtypedtree on a file with classes in it:

    $ cat test.ml
    class foo = object
      method m = 3
    end

    $ ocamlc -dtypedtree test.ml
    [
      structure_item (test.ml[1,0+0]..test.ml[3,34+3])
        Pstr_class
        [
          class_declaration (test.ml[1,0+6]..test.ml[3,34+3])
            pci_virt = Concrete
            pci_params =
              <params> (test.ml[1,0+5]..test.ml[1,0+5]) ghost
                []
            pci_name = "foo"
            pci_expr =
              class_expr (test.ml[1,0+12]..test.ml[3,34+3])
                Pcl_structure
                class_structure
                  pattern (_none_[1,0+-1].._none_[1,0+-1]) ghost
                    Ppat_alias "selfpat-1/1013"
                    pattern (_none_[1,0+-1].._none_[1,0+-1]) ghost
                      Ppat_alias "selfpat-*/1012"
                      pattern (test.ml[1,0+18]..test.ml[1,0+18]) ghost
                        Ppat_any
                  [
    Fatal error: exception Assert_failure("typing/printtyped.ml", 496, 26)

As a side note, -dtypedtree should probably print out `Tfoo` rather than `Pfoo`.
Tagspatch
Attached Filespatch file icon fix-printtyped.patch [^] (3,975 bytes) 2014-06-09 15:05 [Show Content]

- Relationships

-  Notes
(0011710)
lpw25 (developer)
2014-06-09 15:04

The attached patch fixes the -dtypedtree printing for classes.
(0011717)
frisch (developer)
2014-06-10 11:10

Thanks! Committed to 4.02, revision 14980.

- Issue History
Date Modified Username Field Change
2014-04-24 00:48 lpw25 New Issue
2014-06-04 21:53 doligez Status new => confirmed
2014-06-04 21:53 doligez Target Version => 4.03.0+dev
2014-06-09 15:04 lpw25 Note Added: 0011710
2014-06-09 15:05 lpw25 File Added: fix-printtyped.patch
2014-06-09 15:05 lpw25 Tag Attached: patch
2014-06-10 11:10 frisch Note Added: 0011717
2014-06-10 11:12 frisch Status confirmed => resolved
2014-06-10 11:12 frisch Fixed in Version => 4.02.0+dev
2014-06-10 11:12 frisch Target Version 4.03.0+dev => 4.02.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker