# Method without result

**URL:** https://talk.remobjects.com/t/method-without-result/16337
**Category:** Oxygene
**Created:** [May 9, 2018, 6:32pm UTC](https://talk.remobjects.com/t/method-without-result/16337 "2018-05-09T18:32:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![justacoder](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/j/cdc98d/32.png) [@justacoder](https://talk.remobjects.com/u/justacoder)
#### Post date: [May 9, 2018, 6:32pm UTC](https://talk.remobjects.com/t/method-without-result/16337/1 "2018-05-09T18:32:35Z")

</div>

Oxygene .2275 .NET. Would you consider this to be a compiler bug? It would be useful to trap the omission:

method returnbyte: byte;  
var  
b : byte;  
begin  
b := 5;  
end;

There’s no result := b statement, so the method does nothing. Easy to forget when coding.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [May 9, 2018, 11:10pm UTC](https://talk.remobjects.com/t/method-without-result/16337/2 "2018-05-09T23:10:25Z")

</div>

no. result is implicitly preinitialized to default(type). this is valid code and will return 0.
