Skip to content
New issue

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

Atribuição por retorno de função não está pegando o tipo do função e do struct #32

Closed
joraojr opened this issue Dec 3, 2019 · 0 comments
Labels
bug Something isn't working semantic Semantic checking related issues

Comments

@joraojr
Copy link
Collaborator

joraojr commented Dec 3, 2019

Para o código

typedef struct {
int a;
float b;
} c;

float f (int c, float b) {

c = c + 2;
b = b + 1.21;
if(a)
b = 2e10;

return b;
}

char v;

int main (){
char v;
char * z;
c *x;
x->a=2;
x->b= f(2,3);

v = '\n';
try{
z = "abacasad";
} catch (...) throw;
return 0;
}

Dá erro de atribuição de tipo nas linhas :
x->a=2;
x->b= f(2,3);

[SEMANTIC ERROR - assignNode] CANNOT ASSIGN AN EXPRESSION TO A DIFFERENT TYPE, line: 22
[SEMANTIC ERROR - callNode] PARAMETER TYPE MISMATCH, line: 23 parameter: b

@joraojr joraojr added bug Something isn't working semantic Semantic checking related issues labels Dec 3, 2019
@joraojr joraojr changed the title Atribuição por retorno de função está pegando o tipo do parâmetro Atribuição por retorno de função não está pegando o tipo do função Dec 3, 2019
@joraojr joraojr changed the title Atribuição por retorno de função não está pegando o tipo do função Atribuição por retorno de função não está pegando o tipo do função e do struct Dec 3, 2019
@joraojr joraojr closed this as completed Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working semantic Semantic checking related issues
Projects
None yet
Development

No branches or pull requests

1 participant