1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-17 05:28:37 +01:00

Updated initialiser

This commit is contained in:
Adit Mehta 2019-04-06 00:03:34 +05:30 committed by GitHub
parent 06a5fd28ab
commit 808e0cadd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -708,7 +708,7 @@ class MyClass {
// We also get the compiler-generated initializer, with one argument per field.
// Note that soon there will be no compiler-generated initializer when we
// define any initializer(s) explicitly.
proc MyClass(val : real) {
proc init(val : real) {
this.memberInt = ceil(val): int;
}