tonynhan / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

bulid error in mono 2.01 #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please include an e-mail address if this might need a dialogue!
==============

What steps will reproduce the problem?
1. Bulid in MonoDevelop opensuse 11.0 mono 2.01
2.
3.

What is the expected output? What do you see instead?
This is the error:
[Task:File=/home/kiminozo.eien/protobuf-net/protobuf-net/Property/
PropertyTimeSpanFixed.cs, Line=16, Column=26, Type=Error, Priority=Normal, 
Description=The type `ProtoBuf.Property.PropertyTimeSpanString<TSource>' must 
be 
convertible to 
`ProtoBuf.Property.Property<ProtoBuf.Property.PropertyTimeSpanString<TSource>>' 
in 
order to use it as parameter `T' in the generic type or method 
`ProtoBuf.Property.Property<TSource,TValue>.CreateAlternative<T>
(ProtoBuf.DataFormat)'(CS0309)]

What version of the product are you using? On what operating system?
217 
opensuse 11.0 mono 2.01

Please provide any additional information below.

I think this error is a mono's bug, I Fixed Property.cs line 132 like this:
but it is not a good way.

protected Property<TSource> CreateAlternative<T>(DataFormat format) where T : 
new
() //Property<TSource>, new()
        {
            Property<TSource> alt = new T() as Property<TSource>;
            if(alt != null){
                alt.Init(Tag, format, getValue, setValue, IsOptional, 
DefaultValue);
            }
            return alt;
        }

Original issue reported on code.google.com by kiminozo...@gmail.com on 10 Dec 2008 at 3:01

GoogleCodeExporter commented 8 years ago
Oops; looks like I've gotten lazy with testing the mono build (my automated 
build 
only covers the 5 MS variants).

I can reproduce this; it isn't the first mono compiler bug we've seen with 
generics; 
I reported two that were fixed for the 2.0 release (and hacked the code to make 
it 
build on earlier platforms); I'll see if I can get this one to work (neatly).

Thanks for reporting this.

Original comment by marc.gravell on 10 Dec 2008 at 5:23

GoogleCodeExporter commented 8 years ago
Fixed r219; mono now added to build script and published zip archive

Original comment by marc.gravell on 10 Dec 2008 at 8:27

GoogleCodeExporter commented 8 years ago
Closed (verified)

Original comment by marc.gravell on 6 Jan 2009 at 7:51