# Field macros compile error when using wrapper class - what did I miss?

**URL:** <https://verificationacademy.com/forums/t/field-macros-compile-error-when-using-wrapper-class-what-did-i-miss/32229>\
**Category:** UVM\
**Tags:** UVM, field-macros\
**Created:** [September 6, 2016, 3:35pm UTC](https://verificationacademy.com/forums/t/field-macros-compile-error-when-using-wrapper-class-what-did-i-miss/32229 "2016-09-06T15:35:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![soloist\_huaxin](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@soloist\_huaxin](https://verificationacademy.com/forums/u/soloist_huaxin)\
**Post date:** [September 6, 2016, 3:58pm UTC](https://verificationacademy.com/forums/t/field-macros-compile-error-when-using-wrapper-class-what-did-i-miss/32229/3 "2016-09-06T15:58:21Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/field-macros-compile-error-when-using-wrapper-class-what-did-i-miss/32229/2):_

I removed the field macro, and added factory registration in base class, but the same compile error is still there. below are my classes:

class base\_data extends uvm\_sequence\_item;  
`uvm\_object\_utils(base\_data);  
//constructor  
endclass

class my\_data extends base\_data;  
rand int val;  
`uvm\_object\_utils(my\_data); //compiler complains this line have token ‘#’

//constructors, constraints, etc  
endclass

---

_[View the full topic](https://verificationacademy.com/forums/t/field-macros-compile-error-when-using-wrapper-class-what-did-i-miss/32229)._
