Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:22:26+00:00 2026-06-03T14:22:26+00:00

I am relatively new to Vala and I’m trying to port some C# code

  • 0

I am relatively new to Vala and I’m trying to port some C# code into vala by hand and I have started out with a trivial example to test it out.

C# coders will recognize the snippet below as being 1-1 mapping to C#.

Here is the test vala file Universe.vala:

namespace Universe
{
    public interface Planet
    {
        string Name { get; }
    }
}

I get the compilation error:

Universe.vala: error: property getter must have a body

It would appear that Vala does not support get(set)ter properties in interfaces – or am I missing something?. How do I fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:22:28+00:00Added an answer on June 3, 2026 at 2:22 pm

    In Vala interfaces can still contain non-abstract properties and methods (but no variables). This means if you want to define an abstract property or method, you still need to use the abstract keyword, just like you would in an abstract class.

    Since you did not use the abstract keyword here, the compiler thinks you’re trying to define a non-abstract property. However non-abstract properties in interfaces need an explicit body (because the default implementation would need to use variables, which are not allowed). So that’s why the error message is complaining about the missing body.

    Just add the abstract keyword and it will work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Relatively new to JQuery. I've got some code that does a banner swap with
I am relatively new to using SQLite on Android. I have some experience with
im relatively new to ROR, and would like some help with the following code.
I'm relatively new to ruby and I'm trying to figure out the ruby way
Im relatively new to the Android world but I have a quick question. I
I'm relatively new javascript, but I am comfortable in other languages. I'm trying to
I'm relatively new to X Code and I m working on photo collage App
I'm relatively new to Java and I'm still trying to understand the fundamentals. I
Relatively new to C#; hopefully I'm just overlooking something simple. I have a form
I am new to using QT and relatively new to C++. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.