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

"declared at" part is empty #18

Closed
skogsbaer opened this issue Sep 23, 2021 · 2 comments
Closed

"declared at" part is empty #18

skogsbaer opened this issue Sep 23, 2021 · 2 comments

Comments

@skogsbaer
Copy link
Owner

Code:

from wypp import *

@record
class Course:
    name: str
    teacher: str
    students: tuple[str, ...]

@record(mutable=True)
class CourseM:
    name: str
    teacher: str
    students: tuple[str, ...]

@record
class Semester:
    degreeProgram: str
    semester: str
    courses: tuple[CourseM, ...]

prog1 = Course('Programmierung 1', 'Wehr', ())
semester1_2020 = Semester('AKI', '1. Semester 2020/21', (prog1, ))

Error:

untypy.error.UntypyTypeError
given:    Course(name='Programmierung 1', teacher='Wehr', students=())
expected: value of type CourseM

context: Semester(degreeProgram: str, semester: str, courses: tuple[CourseM, ...]) -> Self
                                                                    ^^^^^^^
declared at:

caused by: test.py:22
 22 | semester1_2020 = Semester('AKI', '1. Semester 2020/21', (prog1, ))

The error is correct, but the "declared at" part is missing.

@CodeSteak
Copy link
Collaborator

Duplicate of #13.
Fixed by #22

@skogsbaer
Copy link
Owner Author

Yeah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants