@@ -33,13 +33,14 @@ public static partial class HardwireInterop
3333
3434 static void GenerateField ( TabbedWriter tw , string typeName , HardwireField f )
3535 {
36- tw . Append ( "private sealed class " ) . Append ( f . ClassName ) . Append ( " : " ) . AppendLine ( CLS_PROP_FIELD ) ;
36+ tw . Append ( "private sealed class " ) . Append ( f . ClassName ) . Append ( " : " ) . Append ( CLS_PROP_FIELD )
37+ . Append ( "<" ) . Append ( f . Type ) . AppendLine ( ">" ) ;
3738 tw . AppendLine ( "{" ) . Indent ( ) ;
3839 tw . Append ( "internal " ) . Append ( f . ClassName ) . AppendLine ( "() :" ) ;
3940 var access = 0 ;
4041 if ( f . Read ) access += 1 ; //CanRead
4142 if ( f . Write ) access += 2 ; //CanWrite
42- tw . Indent ( ) . Append ( "base(typeof(" ) . Append ( f . Type ) . Append ( "), ")
43+ tw . Indent ( ) . Append ( "base(" )
4344 . Append ( f . Name . ToLiteral ( ) ) . Append ( ",false," )
4445 . Append ( "(WattleScript.Interpreter.Interop.BasicDescriptors.MemberDescriptorAccess)" )
4546 . Append ( access . ToString ( ) ) . AppendLine ( ")" ) . UnIndent ( ) ;
@@ -48,19 +49,19 @@ static void GenerateField(TabbedWriter tw, string typeName, HardwireField f)
4849 if ( f . Read )
4950 {
5051 tw . AppendLine (
51- "protected override object GetValueImpl(WattleScript.Interpreter.Script script, object obj) {" )
52+ $ "protected override { f . Type } GetValueImpl(WattleScript.Interpreter.Script script, object obj) { {")
5253 . Indent ( ) ;
5354 tw . Append ( "var self = (" ) . Append ( typeName ) . AppendLine ( ")obj;" ) ;
54- tw . Append ( "return (object) self." ) . Append ( f . Name ) . AppendLine ( ";" ) ;
55+ tw . Append ( "return self." ) . Append ( f . Name ) . AppendLine ( ";" ) ;
5556 tw . UnIndent ( ) . AppendLine ( "}" ) ;
5657 }
5758 if ( f . Write )
5859 {
5960 tw . AppendLine (
60- "protected override void SetValueImpl(WattleScript.Interpreter.Script script, object obj, object value) {" )
61+ $ "protected override void SetValueImpl(WattleScript.Interpreter.Script script, object obj, { f . Type } value) { {")
6162 . Indent ( ) ;
6263 tw . Append ( "var self = (" ) . Append ( typeName ) . AppendLine ( ")obj;" ) ;
63- tw . Append ( "self." ) . Append ( f . Name ) . Append ( " = (" ) . Append ( f . Type ) . AppendLine ( ") value;") ;
64+ tw . Append ( "self." ) . Append ( f . Name ) . AppendLine ( " = value;" ) ;
6465 tw . UnIndent ( ) . AppendLine ( "}" ) ;
6566 }
6667 tw . UnIndent ( ) . AppendLine ( "}" ) ;
0 commit comments