Boo

A class with a static constructor emits 'beforeFieldInit'

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.8.2
  • Fix Version/s: 0.9
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

static class Foo:
     _x = System.Collections.Generic.List[of int]()

     def constructor():
           #optional initialization stuff

     def X():
           pass

     def Bar():
           _x.Add(1)

The type Foo is emitted with beforeFieldInit CIL attribute on it.

This means the constructor is not guaranteed to be executed even if we call method X.

Activity

Hide
Cedric Vivier added a comment -

fixed in rev. 2965

Show
Cedric Vivier added a comment - fixed in rev. 2965

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: