Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006182OCamlOCaml typingpublic2013-09-16 19:442013-09-17 13:28
Reporterlpw25 
Assigned Tofrisch 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.01.0 
Target VersionFixed in Version4.02.0+dev 
Summary0006182: Better message for invalid uses of "virtual"
DescriptionThe attached patch (based on one by Stephen Dolan) gives a more accurate error message if you include virtual methods in an immediate object or class type.

Before:

  # class x = object method virtual m : int end;;
  Characters 6-43:
    class x = object method virtual m : int end;;
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Error: This class should be virtual. The following methods are undefined : m

  # class type x = object method virtual m : int end;;
  Characters 11-48:
    class type x = object method virtual m : int end;;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Error: This class should be virtual. The following methods are undefined : m

  # let x = object method virtual m : int end;;
  Characters 8-41:
    let x = object method virtual m : int end;;
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Error: This class should be virtual. The following methods are undefined : m

After:

  # class x = object method virtual m : int end;;
  Characters 6-43:
    class x = object method virtual m : int end;;
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Error: This class should be virtual. The following methods are undefined : m

  # class type x = object method virtual m : int end;;
  Characters 11-48:
    class type x = object method virtual m : int end;;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Error: This class type should be virtual.
         The following methods are undefined : m

  # let x = object method virtual m : int end;;
  Characters 8-41:
    let x = object method virtual m : int end;;
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Error: This object has virtual methods.
         The following methods are undefined : m
TagsNo tags attached.
Attached Filespatch file icon fix-virtual-obj-error.patch [^] (3,470 bytes) 2013-09-16 19:44 [Show Content]

- Relationships

-  Notes
(0010363)
frisch (developer)
2013-09-17 13:28

Thanks!

Applied to trunk, commit 14155.

- Issue History
Date Modified Username Field Change
2013-09-16 19:44 lpw25 New Issue
2013-09-16 19:44 lpw25 File Added: fix-virtual-obj-error.patch
2013-09-17 13:28 frisch Note Added: 0010363
2013-09-17 13:28 frisch Status new => resolved
2013-09-17 13:28 frisch Fixed in Version => 4.02.0+dev
2013-09-17 13:28 frisch Resolution open => fixed
2013-09-17 13:28 frisch Assigned To => frisch


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker