We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I solve the error I get when compiling PointB?
import math // Builds just fine PointA: cover { x, y: Float init: func@ (=x, =y) Negative: func -> This { This new(-this x, this y) } } // Does not build, "error: field ‘Negative’ has incomplete type" PointB: cover { x, y: Float init: func@ (=x, =y) Negative: This { get { This new(-this x, -this y) } } } // Builds just fine, but obviously doesn't do what I want PointC: cover { x, y: Float init: func@ (=x, =y) Negative: static This { get { This new(-1, -1) } } } // Does not build, since static methods obviously do not have access to instance variables PointD: cover { x, y: Float init: func@ (=x, =y) Negative: static This { get { This new(-this x, -this y) } } }
The text was updated successfully, but these errors were encountered:
Here's a runnable test case:
import math // Does not build, "error: field ‘negated’ has incomplete type" PointB: cover { x, y: Float init: func@ (=x, =y) negated: This { get { This new(-this x, -this y) } } _: String { get { "(#{x}, #{y})" } } } main: func { p1 := PointB new(12, 15) p2 := p1 negated "p2 = #{p2 _}" }
It fails because virtual properties still end up in the cover's struct definition for some reason, definitely a C backend bug:
struct _issue781__PointB { lang_Numbers__Float x; lang_Numbers__Float y; issue781__PointB negated; lang_String__String* _; };
@fredreichbier are you around these days? Can you take a look at this maybe? Or @Shamanas ?
Sorry, something went wrong.
Runnable test case:
import math // Does not build, "error: field ‘negated’ has incomplete type" PointB: cover { x, y: Float init: func@ (=x, =y) negated: This { get { This new(-this x, -this y) } } _: String { get { "(#{x}, #{y})" } } } main: func { p1 := PointB new(12, 15) p2 := p1 negated "p2 = #{p2 _}" println() }
Correct output:
p2 = (-12.000000, -15.000000)
Closes #781
40be3b6
fasterthanlime
No branches or pull requests
How do I solve the error I get when compiling PointB?
The text was updated successfully, but these errors were encountered: